0

The ToC of my thesis has a too long dotted line between a section's title and the page number in multiple places. An example is shown in the image below, marked in red. The same problem also happens for various entries in the List of Tables and List of Listings.

Dotted lines in ToC have non-equal length

None of the commands for the dotted lines have been redefined, except for the List of Listings, for which it is defined as:

\makeatletter
\renewcommand*{\l@lstlisting}{\@dottedtocline{1}{0.0em}{2.3em}}
\makeatother

I've searched high and low for probable causes and solutions, but the internet does not seem to be my friend today. Has anyone got an idea of how to solve this?

4
  • Full minimal example please. Without it we cannot replicate your problem.
    – daleif
    Jun 25 '14 at 11:52
  • 2
    It seems that, somehow, you're using “proportional” numbers, so 11 occupies less space than 12.
    – egreg
    Jun 25 '14 at 12:01
  • @egreg It seems you're on to something here! Let me see if I can change that and if it solves the problem.
    – AVH
    Jun 25 '14 at 12:18
  • 1
    @egreg Redefining the page number column width \@pnumwidth to a "fixed" value (6.5mm) fixed the problem. Setting it to 1.55em (the default) makes the problem reappear, very strange. Anyway, thanks a lot for pointing me in the right direction!
    – AVH
    Jun 25 '14 at 12:42
0

As pointed out by @egreg, the font I'm using does not have monospaced numbers. For some reason, this leads to the problem. By redefining the width of the page number column to a fixed value (one independent on the font used), all dotted lines become the same length.

Here's a solution using tocloft, using a length which should be very similar to the default 1.55em:

\makeatletter
\renewcommand{\@pnumwidth}{6.5mm}
\makeatother

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.