The TeX FAQ

Frequently Asked Question List for TeX

Usage

Numbers too large in table of contents, etc.

LaTeX constructs the table of contents, list of figures, tables, and similar tables, on the basis of a layout specified in the class. As a result, they do not react to the sizes of things in them, as they would if a tabular environment (or something similar) was used.

This arrangement can provoke problems, most commonly with deep section nesting or very large page numbers: the numbers in question just don’t fit in the space allowed for them in the class.

A separate answer discusses re-designing the tables and techniques from that answer may be employed to make the numbers fit:

\setlength\cftsectionnumwidth{4em}

The same command may be employed in documents typeset with the memoir package (by the same author as tocloft).

Memoir has another mechanism for the job: \cftsetindents{<kind>}{indent}{numwidth}. Here kind is chapter, section, or whatever; the indent specifies the “margin” before the entry starts; and the width is of the box into which the number is typeset (so needs to be wide enough for the largest number, with the necessary spacing to separate it from what comes after it in the line.

FAQ ID: Q-tocloftwrong