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.

This question already has an answer here:

When making long documents under book class if one needs 10 or more chapters, something weird happens with the table of contents: the space between the number of the chapter and its title disappears, just like it was trying to preserve a beautiful alignment on the left but leading to an incorrect output.

enter image description here

Here's a MWE:

\documentclass[spanish, 12pt]{book}

\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}

\begin{document}

\tableofcontents

\chapter{A}
\newpage
\chapter{B}
\newpage
\chapter{C}
\newpage
\chapter{D}
\newpage
\chapter{E}
\newpage
\chapter{F}
\newpage
\chapter{G}
\newpage
\chapter{H}
\newpage
\chapter{I}
\newpage
\chapter{J}
\newpage
\chapter{K}
\end{document}

To be honest, I have no idea how to fix this. I hope you guys do.

share|improve this question

marked as duplicate by Werner, Jesse, barbara beeton, Malipivo, Masroor Apr 18 at 13:32

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.

    
Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Christian Hupfer Apr 18 at 11:57
    
I can confirm the behaviour you described! –  Christian Hupfer Apr 18 at 12:06
    
The space allocated for the chapter number width is 1.5em by default. You can adjust that to your liking by following the etoolbox patch suggested in Space length between the chapter number and the chapter title. –  Werner Apr 18 at 12:42
    
NB: the command \newpage is redundant here, as the book chapters start on the right side as default. –  LaRiFaRi Apr 18 at 12:44

1 Answer 1

up vote 6 down vote accepted

You can use the tocloft package to adjust the spacing:

\documentclass[12pt]{book}
\usepackage{tocloft}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}

\setlength{\cftchapnumwidth}{2em}

\begin{document}

\tableofcontents

\chapter{A}\chapter{B}\chapter{C}\chapter{D}
\chapter{E}\chapter{F}\chapter{G}\chapter{H}
\chapter{I}\chapter{J}\chapter{K}

\end{document}
share|improve this answer
    
I usually advise to call the package as \usepackage[titles]{tocloft} in order to avoid a certain (not so nice) feature. –  egreg Apr 18 at 13:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.