2

This is a follow-up question to KOMA-Script: Pagenumber immediately after heading in table of contents.

If I use the suggestion in the answer, that is

\RedeclareSectionCommands[
  toclinefill=\quad$\cdot$,
  tocraggedpagenumber=true,
  tocindent=0pt
]{chapter,section,subsection}

then I get uneven spacing on the two sides of the dot, like this:

Uneven Spacing around Dots

How can I influence the space that comes on the right side, after the \cdot?

brian-ammon
  • 2,425
  • 1
  • 21
  • 35

1 Answers1

3

Use option tocpagenumberbox:

\documentclass{scrbook}[2016/05/10]
\RedeclareSectionCommands[
  toclinefill=\quad$\cdot$\quad,% changed
  tocraggedpagenumber=true,
  tocpagenumberbox=\tocpagenumberbox,% added
  tocindent=0pt
]{chapter,section,subsection}
\newcommand*\tocpagenumberbox[1]{\mbox{#1}}% added
\begin{document}
\tableofcontents
\chapter{Blah}
\section{blah}
\cleardoubleoddpage
\setcounter{page}{335}
\chapter{Blah}
\section{blah}
\end{document}

Result:

enter image description here

esdd
  • 85,675
  • 26 minutes too late :) – Skillmon Jul 22 '18 at 11:01
  • Is it necessary to put the page numbers into a box? Is there any problem in using tocpagenumberbox=\relax? – brian-ammon Jul 22 '18 at 11:34
  • 1
    tocpagenumberbox=\relax works at the moment, too. But from the documentation: "The command should expect exactly one argument, the page number." So I would use at least an command like \newcommand*\tocpagenumber[1]{#1}. – esdd Jul 22 '18 at 11:53