# Bad TOC entries spacing for chapter 10 and beyond [duplicate]

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.

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.

-

## marked as duplicate by Werner, Jesse, barbara beeton, Malipivo, MasroorApr 18 at 13:32

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

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}

-
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