Roman numerals become “too wide” in table of contents

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)


For the record, I ended up using the tocloft package, as follows

\usepackage[titles]{tocloft}

(Option titles since all I want from the package is manipulate the space of the table of content lines; the title should still be rendered using the standard LaTeX method).

\renewcommand*\cftchapnumwidth{2em}
\renewcommand*\cftsecnumwidth{3em}

That said, it’s perhaps more appropriate to change the display of the contents lines so that only the section number is displayed for sections, not the whole “chapter.section” number.


tocloft works fine with standard classes. If I use KOMA classes, such as the mentioned scrreprt, I don't like tocloft to redefine class macros. For example, features such as koma fonts and the auto end dot are would be lost.

I would make a small modification myself, so I know that few is changed:

\makeatletter
\renewcommand*{\raggedchapterentry}{\setlength\@tempdima{2.3em}}
\renewcommand*\l@section{\bprot@dottedtocline{1}{1.5em}{3.2em}}
\makeatother

alt text