13

Possible Duplicate:
TOC Text - numbers alignment
How to modify the indentation before sectioning titles in the table of contents?

I have a LaTeX document with many subsections (more than 100), which give rise to an issue. Here is how it looks like for a specific part of the Table of contents:

...
2.98 Subsection whatever.
2.99 One more subsection.
2.100This is the hundredth section.
... 

i.e. the horizontal space between the subsection number and the name of the subsection gets to zero. Is there an easy way to increase this space, so the subsection title does not 'touch' the section numbering?

  • Welcome to TeX.sx! Your question was migrated here from another stackexchange site. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. – lockstep Jan 03 '12 at 19:56

1 Answers1

16

For what it's worth, tocloft provides the length \cftsubsecnumwidth which represents the width of the box containing the \subsection numbers in them. Redefining this length solves your problem. Here's a minimal example:

enter image description here

\documentclass{article}
\usepackage{tocloft}% http://ctan.org/pkg/tocloft
\setlength{\cftsubsecnumwidth}{4em}% Set length of number width in ToC for \subsection
\makeatother
\begin{document}
\tableofcontents
\section{This is a section}
\subsection{This is a subsection}
\setcounter{subsection}{999}
\subsection{This is another subsection}
\end{document}
Werner
  • 603,163