I would like to fix a little dots glitch in my ToC. Here's a MWE showing the issue:


\makeatletter  % To fix a spacing problem with page number.
\renewcommand{\@pnumwidth}{2em} %

% Chapters spacement :
\setlength{\cftchapindent}{0em} % Spacement to left of chapter number.
\setlength{\cftchapnumwidth}{0em} %

% Sections spacement :
\renewcommand{\cftsecpresnum}{\hfill} % \quad
\renewcommand{\cftsecaftersnum}{\hspace{0.75em}} % \enskip = 0.5em = demi \quad
\setlength{\cftsecindent}{0em} %
\setlength{\cftsecnumwidth}{4em} %
%\addtolength{\cftsecnumwidth}{0em} %


\microtypesetup{protrusion=false} % To fix extra dots in ToC

\section{Section title}
\section{A new section title}
\section{Another section title}


Preview (the issue is shown in red):

enter image description here

In this case, I get a relatively large space after the section title (as shown in red), and yet there appears to be space for one more dot. This is occuring frequently in my full ToC, and it irritates me a bit. How can I tell LaTeX to use a smaller space after the section title to add an extra dot? Of course, the dots must all stay aligned at right (as currently shown).

2 Answers 2


The problem that you're running into is that there's no extra space to put another dot as far as LaTeX can tell. Think of the dots as being in little boxes with equal amounts of space on either side of the . The actual amount is \@dotsep mu (one mu is 1/18 of an em, book sets \@dotsep to 4.5, so you've got effectively half an em of space between dots).

You could redefine \@dottedtocline to make the spacing around the box with the dot asymmetrical.

  \ifnum #1>\c@tocdepth \else
    \vskip \z@ \@plus.2\p@
    {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
     \parindent #2\relax\@afterindenttrue
     \@tempdima #3\relax
     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep % ⬅︎
     \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5%

I marked the relevant line in the copied definition with ⬅︎. You could change this to have \@ldotsep and \@rdotsep defined appropriately, (you can't just do a prefix before the \@dotsep since \@dotsep is just a macro holding a number and not a length or glue that could be multiplied). Alternatively, you could add a kern before the \leaders to tighten that space.

An ugly solution would be to do something like

\section[Another section title\kern-.1em]{Another section title}

to tighten the spacing there to get the additional dot, but if it's just a single instance, that might be the quickest solution.

  • The problem with the ugly solution is that I'll have to apply it to many section titles. My issue is occurring for several sections in the ToC. So there's no "natural" way of fixing this, in LaTeX?
    – Cham
    Commented Jun 2, 2021 at 17:35

The tocloft package lets you change the separation between the dots in the leaders.

\renewcommand{\cftdotsep}{3.5} % normally 4.5

which will make the dots closer together and may cure your problem.

However, if you change the dotted leader to fix one perceived infelicity in the ToC layout it may well lead to different infelicities in other entries.

My suggestion is to live with what you have got but tell nobody about your "glitch".

  • Oh, I already tested this solution. It often gives the same issue. So should I understand that there's no "natural" fix for my issue?
    – Cham
    Commented Jun 2, 2021 at 17:32
  • @Cham I can't think of a natural fix. The space between the title and the page number is filled by a sequence of dots with fixed spacing. You could start the dots a little to the left but then they would finish more to the left of the page number. Perhaps the "nautural" fix is to have no dots (cftnodots). Commented Jun 2, 2021 at 17:46
  • Well, I could try a larger spacing on the right (next to the page number), but only if that space is constant. So what do you propose to begin the dots closer to the left? If the spacing is variable next to the page number, then it would be worst!
    – Cham
    Commented Jun 2, 2021 at 17:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .