我将“amsbook.cls”文件与命令一起使用
\documentclass[a4paper,12pt,twoside]{amsbook}
\DeclareRobustCommand{\SkipTocEntry}[4]{}
\makeatletter
\newcommand\Dotfill{\leavevmode\cleaders\hb@[email protected]{\hss.\hss}\hfill\kern\z@}
\makeatother
...
在目录 (TOC) 的节级内创建点。`amsbook.cls' 文件进行了相应修改(请注意注释)
\def\@toclevel{0}
\def\@tocline#1#2#3#4#5#6#7{\relax
\ifnum #1>\c@tocdepth
\else
\par \addpenalty\@secpenalty\addvspace{#2}%
\begingroup \hyphenpenalty\@M
\@ifempty{#4}{%
\@tempdima\csname r@tocindent\number#1\endcsname\relax
}{%
\@tempdima#4\relax
}%
\parindent\z@ \leftskip#3\relax \advance\leftskip\@tempdima\relax
\rightskip\@pnumwidth plus4em \parfillskip-\@pnumwidth
#5\leavevmode\hskip-\@tempdima #6\nobreak\relax
% \hfil\hbox to\@pnumwidth{\@tocpagenum{#7}}\par % <-- we commented this line out
\ifnum#1<\c@tocdepth\hfill\else\Dotfill\fi\hbox to\@pnumwidth{\@tocpagenum{#7}}\par % <-- and, instead, use this line to allow for dots in the TOC
\nobreak
\endgroup
\fi}
但是,圆点对齐在左侧而不是右侧(见下图)。如何将圆点对齐在页码右侧?
答案1
\cleaders
使点不对齐、居中。如果使用\leaders
(或标准 latex \@dottedtocline
),则每行上的点将与其他行处于相同的水平位置