Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
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
add comment

migrated from stackoverflow.com Jan 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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

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}
share|improve this answer
    
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
add comment