在哪裡可以找到 scrbook.cls 最新版本(3.24)的源代碼?

在哪裡可以找到 scrbook.cls 最新版本(3.24)的源代碼?

我想重新定義\@maketitle的命令scrbook。因此我需要scrbook類別的源代碼。我的電腦上沒有安裝 Miktex 或 Texlive,我只使用 sharelatex。

我知道可以使用\show\meaning獲取定義,但我需要一個也顯示縮排的輸出。

答案1

正如我的評論中指出的,

CTAN 是一個很好的來源,也是我首選的地方。為了scrbook,嘗試ctan.org/pkg/scrbook?lang=en。該頁面有 TDS 存檔、koma-script.tds.zip文件下載。在 zip 檔案子目錄中,您將找到:tex\latex\koma-script\scrbook.cls. V3.24 已確認。

的定義\@maketitle

\newcommand*{\@maketitle}{%
  \global\@topnum=\z@
  \setparsizes{\z@}{\z@}{\z@\@plus 1fil}\par@updaterelative
  \ifx\@titlehead\@empty \else
    \begin{minipage}[t]{\textwidth}
      \usekomafont{titlehead}{\@titlehead\par}%
    \end{minipage}\par
  \fi
  \null
  \vskip 2em%
  \begin{center}%
    \ifx\@subject\@empty \else
      {\usekomafont{subject}{\@subject \par}}%
      \vskip 1.5em
    \fi
    {\usekomafont{title}{\huge \@title \par}}%
    \vskip .5em
    {\ifx\@subtitle\@empty\else\usekomafont{subtitle}\@subtitle\par\fi}%
    \vskip 1em
    {%
      \usekomafont{author}{%
        \lineskip .5em%
        \begin{tabular}[t]{c}
          \@author
        \end{tabular}\par
      }%
    }%
    \vskip 1em%
    {\usekomafont{date}{\@date \par}}%
    \vskip \z@ \@plus 1em
    {\usekomafont{publishers}{\@publishers \par}}%
    \ifx\@dedication\@empty \else
      \vskip 2em
      {\usekomafont{dedication}{\@dedication \par}}%
    \fi
  \end{center}%
  \par
  \vskip 2em
}%

答案2

當您使用 ShareLaTeX 時,您必須修補scrbook.clsShareLaTeX 提供的補丁。

在 ShareLaTeX 上編譯以下文件以獲得正確的原始碼(96 頁,帶有顏色):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
%\usepackage[margin=1cm]{geometry}
\usepackage{fancyvrb}
\usepackage{listings}
\usepackage{accsupp}
\newcommand*{\noaccsupp}[1]{\BeginAccSupp{ActualText={}}#1\EndAccSupp{}}

\title{\texttt{scrbook.cls} listing on ShareLaTeX}
\author{Paul Gaborit}
\date{February 2018}
\lstdefinestyle{latex}{
  fancyvrb=true,
  language=[LaTeX]TeX,
  basicstyle=\ttfamily\scriptsize,
  keywordstyle=\color{blue}\bfseries,
  commentstyle=\color{red!50!black}\itshape,
  stringstyle=\ttfamily\color{green!50!black},
  numbers=left,
  numberstyle=\tiny\color{gray}\noaccsupp,
  stepnumber=1,
  numbersep=5pt,
  showspaces=false,
  showstringspaces=false,
  %backgroundcolor=\color{white},
  frame=leftline,
  rulecolor=\color{gray!30},
  fontadjust=true,
  aboveskip=0pt,
  belowskip=0pt,
  emphstyle=\color{red},
  keepspaces=true,
  flexiblecolumns=true,
  xleftmargin=1.2em,
}


\begin{document}

\maketitle

\lstinputlisting[style=latex]{scrbook.cls}
\end{document}

答案3

您問了錯誤的問題,這種情況在 tex.sx 上經常發生。您(可能)是 LaTeX 的新手,並且您想對您的文章/報告/書籍的標題做一些事情。

請提出一個關於您最終想要實現的目標的新問題。

侵入像 KOMA 腳本包這樣的主線包可能既不值得付出努力,也不值得走。沒有它也可以實現許多佈局。只需要求添加 MWE 即可。

相關內容