我用的是施普林格斯沃多為帶有編輯器的書籍模板。目錄 (ToC) 存在問題:
當節號僅包含數字 1-9 時,一切看起來都正常,例如
- 標頭
1.1 副標題
1.2.9 副標題
但是當節數超過 10 時,標題文字和節號在目錄中太接近,甚至開始重疊。這看起來很難看(比這裡更糟):
- 標頭
1.10副標題
1.3.10副標題
12.2.3Sub子標題
以下是\tableofcontents
in的定義svmult.cls
。我只理解了一半,在這種情況下這還不夠。我需要在哪裡解決問題,以便目錄中的節號和節標題之間始終有足夠的空間?
\def\tableofcontents{\chapter*{\contentsname\markboth{{\contentsname}}%
{{\contentsname}}}
\def\authcount##1{\setcounter{auco}{##1}\setcounter{@auth}{1}}
\def\lastand{\ifnum\value{auco}=2\relax
\unskip{} \andname\
\else
\unskip \lastandname\
\fi}%
\def\and{\stepcounter{@auth}\relax
\ifnum\value{@auth}=\value{auco}%
\lastand
\else
\unskip,
\fi}%
\@starttoc{toc}\if@restonecol\twocolumn\fi}
\setcounter{tocdepth}{0}
\def\l@part#1#2{\addpenalty{\@secpenalty}%
\addvspace{2em \@plus\p@}%
\begingroup
\parindent \z@
\rightskip \z@ \@plus 5em
\hrule\vskip5\p@
\bfseries\boldmath
\leavevmode
#1\par
\vskip5\p@
\hrule
\vskip\p@
\nobreak
\endgroup}
\def\@dotsep{2}
\def\addnumcontentsmark#1#2#3{%
\addtocontents{#1}{\protect\contentsline{#2}{\protect\numberline
{\thechapter}#3}{\thepage}}}
\def\addcontentsmark#1#2#3{%
\addtocontents{#1}{\protect\contentsline{#2}{#3}{\thepage}}}
\def\addcontentsmarkwop#1#2#3{%
\addtocontents{#1}{\protect\contentsline{#2}{#3}{0}}}
\def\@adcmk[#1]{\ifcase #1 \or
\def\@gtempa{\addnumcontentsmark}%
\or \def\@gtempa{\addcontentsmark}%
\or \def\@gtempa{\addcontentsmarkwop}%
\fi\@gtempa{toc}{chapter}}
\def\addtocmark{\@ifnextchar[{\@adcmk}{\@adcmk[3]}}
\def\l@chapter#1#2{\par\addpenalty{-\@highpenalty}
\addvspace{1.0em \@plus \p@}
\@tempdima \tocchpnum \begingroup
\parindent \z@ \rightskip \@tocrmarg
\advance\rightskip by \z@ \@plus 2cm
\parfillskip -\rightskip \pretolerance=10000
\leavevmode \advance\leftskip\@tempdima \hskip -\leftskip
{\bfseries\boldmath#1}\ifx0#2\hfil\null
\else
\nobreak
\leaders\hbox{$\m@th \mkern \@dotsep mu\hbox{.}\mkern
\@dotsep mu$}\hfill
\nobreak\hbox to\@pnumwidth{\hss #2}%
\fi\par
\penalty\@highpenalty \endgroup}
\newcommand{\tocauthorstyle}{\itshape}
\newcommand{\toctitlestyle}{\bfseries}
\def\l@title#1#2{\addpenalty{-\@highpenalty}
\addvspace{8\p@ \@plus \p@}
\@tempdima \z@
\tocchpnum \z@ \calctocindent
\begingroup
\parindent \z@ \rightskip \@tocrmarg
\advance\rightskip by \z@ \@plus 2cm
\pretolerance=10000
%\parfillskip -\@tocrmarg
\leavevmode \advance\leftskip\@tempdima \hskip -\leftskip
{\toctitlestyle#1}%\nobreak
%\leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern
%\@dotsep mu$}\hfill
%\nobreak\hbox to\@pnumwidth{\hss #2}\par
\par
\penalty\@highpenalty \endgroup}
\newcommand{\tocaftauthskip}{\z@}
\def\l@author#1#2{%\addpenalty{\@highpenalty}
\@tempdima \z@
\begingroup
\pretolerance=10000
\parindent \z@ \rightskip \@tocrmarg
\advance\rightskip by \z@ \@plus 2cm
\parfillskip -\@tocrmarg
\leavevmode \advance\leftskip\@tempdima \hskip -\leftskip
{\tocauthorstyle#1}\nobreak
\leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern
\@dotsep mu$}\hfill
\nobreak\hbox to\@pnumwidth{\hss #2}\par
\penalty\@highpenalty
\addvspace{\tocaftauthskip}\endgroup}
\newdimen\tocchpnum
\newdimen\tocsecnum
\newdimen\tocsectotal
\newdimen\tocsubsecnum
\newdimen\tocsubsectotal
\newdimen\tocsubsubsecnum
\newdimen\tocsubsubsectotal
\newdimen\tocparanum
\newdimen\tocparatotal
\newdimen\tocsubparanum
\tocchpnum=\z@ % no chapter numbers
\tocsecnum=18\p@ % section 88. plus 2.222pt
\tocsubsecnum=23\p@ % subsection 88.8 plus 2.222pt
\tocsubsubsecnum=27\p@ % subsubsection 88.8.8 plus 1.444pt
\tocparanum=35\p@ % paragraph 88.8.8.8 plus 1.666pt
\tocsubparanum=43\p@ % subparagraph 88.8.8.8.8 plus 1.888pt
\def\calctocindent{%
\tocsectotal=\tocchpnum
\advance\tocsectotal by\tocsecnum
\tocsubsectotal=\tocsectotal
\advance\tocsubsectotal by\tocsubsecnum
\tocsubsubsectotal=\tocsubsectotal
\advance\tocsubsubsectotal by\tocsubsubsecnum
\tocparatotal=\tocsubsubsectotal
\advance\tocparatotal by\tocparanum}
\calctocindent
\def\@dottedtocline#1#2#3#4#5{%
\ifnum #1>\c@tocdepth \else
\vskip \z@ \@plus.2\p@
{\leftskip #2\relax \rightskip \@tocrmarg \advance\rightskip by \z@ \@plus 2cm
\parfillskip -\rightskip \pretolerance=10000
\parindent #2\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima #3\relax
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{#4}\nobreak
\leaders\hbox{$\m@th
\mkern \@dotsep mu\hbox{.}\mkern \@dotsep
mu$}\hfill
\nobreak
\hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
\par}%
\fi}
%
\def\l@section{\@dottedtocline{1}{\tocchpnum}{\tocsecnum}}
\def\l@subsection{\@dottedtocline{2}{\tocsectotal}{\tocsubsecnum}}
\def\l@subsubsection{\@dottedtocline{3}{\tocsubsectotal}{\tocsubsubsecnum}}
\def\l@paragraph{\@dottedtocline{4}{\tocsubsubsectotal}{\tocparanum}}
\def\l@subparagraph{\@dottedtocline{5}{\tocparatotal}{\tocsubparanum}}
答案1
此類別使用以下長度控制為節號保留的空間:
\tocsecnum
對於部分。\tocsubsecnum
對於小節。\tocsubsubsecnum
對於小節。\tocparanum
對於段落。\tocsubparanum
對於分段。
然後您可以簡單地添加一些值到所需的長度;例如:
\addtolength\tocsubsubsecnum{2ex}
然後調用
\calctocindent
以便可以重新計算下部截面單元條目的長度。