[Tex/LaTex] Roman numerals become “too wide” in table of contents

indentationroman numeralstable of contents

Following minimal document:

\documentclass{report}

\begin{document}
\renewcommand*\thechapter{\Roman{chapter}}
\tableofcontents
\setcounter{chapter}{6} % Problem starts at chapter 7
\chapter{Seven}
\chapter{Eight}
\section{Eight-one}
\section{Eight-two}
\end{document}

yields this output (cut to size for your convenience):

screenshot

Clearly, the chapter (and section) headings hang into the chapter (section) numbers. For the previous chapter numbers, this isn’t a problem since all chapter titles are aligned to the same column and the numbers I–VI are sufficiently narrow.

(The same happens regardless of document type, I’m actually using scrreprt with the same result.)

How can I prevent this?

Best Answer

You could also use the tocstyle package, part of KOMA-script:

\documentclass[pagesize]{scrreprt}
\usepackage[tocindentauto]{tocstyle}
\usetocstyle{KOMAlike} %the previous line resets it
\begin{document}
\renewcommand*{\thechapter}{\Roman{chapter}}
\tableofcontents
\setcounter{chapter}{6} % Problem starts at chapter 7
\chapter{Seven}
\chapter{Eight}
\section{Eight-one}
\section{Eight-two}
\end{document}

(compile twice)

Related Question