# Adjusting spaces for the ToC [duplicate]

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?

-

## migrated from stackoverflow.comJan 3 '12 at 19:54

This question came from our site for professional and enthusiast programmers.

## marked as duplicate by lockstep, Werner, Marco Daniel, egreg, Torbjørn T.Jan 3 '12 at 20:30

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 3 '12 at 19:56

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:

\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}

-
Now that you've gained an upvote, you may still vote to close. ;-) –  lockstep Jan 3 '12 at 20:11
Similar question tex.stackexchange.com/questions/7853/toc-text-numbers-alignment –  Aku Jan 3 '12 at 20:16