4

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.

jasikevicius23
  • 383
  • 1
  • 2
  • 13

1 Answers1

6

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}
Alex
  • 5,362
  • I usually advise to call the package as \usepackage[titles]{tocloft} in order to avoid a certain (not so nice) feature. – egreg Apr 18 '14 at 13:17