5

I'd like to know how to decrease the column width in the ToC so that the white distance to the page numbers increase. Thanks a lot!

enter image description here

This is the result when I use:

\makeatletter
\renewcommand*\@pnumwidth{2em}
\makeatother

enter image description here

  • tocloft? titlesec? Preference on compiling engine? – Saphar Koshet Nov 12 '18 at 13:11
  • Tough crowd sometimes! It's likely this is a duplicate. That said, see if this QA or this QA gets you started. If not, a more complete MWE would help. Charter is a font; so, it's not part of the problem. And, it'd be Ok to edit the Q to remove tables and columns tags, since this is a ToC issue. tables and columns are typically in the body of the doc. – Saphar Koshet Nov 12 '18 at 13:51
  • Does it matter if you redefine \@pnumwidth before you load packages? – John Kormylo Nov 12 '18 at 16:40
  • No difference ... – mldmnn Nov 14 '18 at 14:29
  • Can you make a minimal working example (MWE) that shows us which class you are using, if there are modifications to the toc etc.? – samcarter_is_at_topanswers.xyz Nov 14 '18 at 14:57
4
+50

This seems to work for me:

\documentclass{book}
\usepackage{tocloft}
\makeatletter
\renewcommand{\@pnumwidth}{3cm}
\renewcommand{\@tocrmarg}{4cm}
\renewcommand{\cftdotsep}{\cftnodots}
\makeatother
\begin{document}
\tableofcontents
\chapter{Longer longer longer longer Longer longer longer longer Longer longer longer longer Longer
  longer longer longer Longer longer longer longer Longer longer longer longer}

Foo.

\chapter{Longer longer longer longer Longer longer longer longer Longer longer longer longer Longer
  longer longer longer Longer longer longer longer Longer longer longer longer}

Bar.

\chapter{Longer longer longer longer Longer longer longer longer Longer longer longer longer Longer
  longer longer longer Longer longer longer longer Longer longer longer longer}

Bar.
\end{document}
| improve this answer | |
  • This worked for me! But now dots appear. How to get rid of it? – mldmnn Nov 14 '18 at 15:26
  • If you have dots, it must be due to some other package that you are using. I've edited my answer to include a MWE without dots. – Eric Marsden Nov 14 '18 at 15:48
  • @EricMarsden See if the chapters are producing the dots, or the sections, e.g., this scenario – Saphar Koshet Nov 14 '18 at 15:52
  • You're right, dots are produced by sections. I updated the MWE to remove dots. – Eric Marsden Nov 14 '18 at 16:09
  • @EricMarsden Good work. – Saphar Koshet Nov 14 '18 at 18:40

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.