tocloft
s \cftXaftersnumb
macro family doesn't work for X
= part
in the book
class. Quoting from the tocloft
manual, p. 9:
In the standard classes the ToC entry for a \part
is just typeset as
the number and title, followed by the page number, with the
\cftpartpresnum
macro being called before typesetting the number and
title. When a standard class is used the \cftpartaftersnum
and
\cftpartaftersnumb
macros have no effect, but they may do something
if a non-standard class is used.
There are three internal LATEX commands that are used in the typesetting the table of contents, lof, lot etc. They are (with their default values):
\@pnumwidth
= 1.55em
\@tocrmarg
= 2.55em
\@dotsep
= 4.5
The page number is typeset flushright in a box of width \@pnumwidth
, and the box is at the righthand margin. If the page number is too long to fit into the box it will stick out into the righthand margin. This is what is happening in your case.
The title text is indented from the righthand margin by
an amount given by \@tocrmarg
.
\@dotsep
gives the distance (in math units) between the dots in the leader.
Your problem is due to big numbers which can not be fitted into the box defined by the default value of \@pnumwidth
. Hence if we make the box bigger everything will be alright. We add the following in the preamble:
\makeatletter
\renewcommand{\@pnumwidth}{3em}
\renewcommand{\@tocrmarg}{4em}
\makeatother
Note that \@pnumwidth
should be always smaller than \@tocrmarg
.
For memoir these can be changed by
\renewcommand*{\cftdotsep}{1}
\setpnumwidth{3em}
\setrmarg{4em}
without any need for \makeatletter
construct.
Best Answer
Using the
tocloft
package, you can redefine\cftpartnumwidth
:Another option, not requiring additional packages is to redefine
\l@part
as defined inscrbook.cls
; here's such a possible redefinition: