TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I’m using the titletoc package to create a TOC. How can I make sure that my dotted lines always touch the number? More precisely, I want the dotted lines to look as in the following image:

enter image description here

share|improve this question
up vote 7 down vote accepted

Here's one possible solution using \contentsmargin and \dottedcontents:





\section{test test test test test test}



And the obtained ToC:

enter image description here

Personally, I don't like much this layout, and would prefer some uniform white space between the rightmost dot and the page numbers.

share|improve this answer
+1 for the very diplomatic "but that's ugly" – Brent.Longborough Mar 16 '12 at 8:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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