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

alt text

I am using \tableofcontents to create TOC in my document. however it is appearing as shown in the image. As the numbers increase the gap between the number and text is reducing.

Thanks for your help Aku

share|improve this question
up vote 17 down vote accepted

You can use the tocloftpackage, e.g.


The lengt \cftXnumwidth defines how wide the space for the number of X should be, where X is part (for \part), chap (for \ \chapter), sec (for \section) etc. See the tocloft manual for a complete list. Set this length to fit your needs.

share|improve this answer
I get an error when including this package in an article: ! LaTeX Error: Command \c@lofdepth already defined. Or name \end... illegal, see p.192 of the manual. – CPBL Nov 18 '15 at 16:19
@CPBL Without testing, I seriously doubt you would get that error if you replace book with article in the code above, so likely there is some other problem. Make a minimal example. – Torbjørn T. Nov 18 '15 at 23:06

You can use a package or simply redefine the section level command as follows:




In the \def\l@section{\@dottedtocline{1}{1em}{2em}} change the 2em to suit. Here is the format of the \@dottedtocline{<level>}{<indent>}{<numwidth>}{<title>}{<page>}.

share|improve this answer
I used your trick because tocloft completely remove all format of the toc. But with your command chapter in the toc are no longer written in bold. How can I fix this ? Maybe it is due to the fact that chapter is not a dotted toc line ? – Ger Sep 3 '12 at 10:14

tocloft is a bit incompatible with KOMA-classes. The KOMA-bundle provides an own package tocstyle, that can be used with the standard classes as well. You can change the appearance of the toc, the right width will be iterated over several latex runs.



share|improve this answer

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.