Roman numerals become “too wide” in table of contents

roman numerals calculator
roman numerals chart
roman numbers
roman numerals 1-100
roman numerals list
roman numeral date converter
d in roman numerals
l in roman numerals

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):

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?

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)

Roman numerals, How do I read and write Roman numerals? Did the Romans use A string of letters means that their values should be added together. For example, XXX = 10 +� As mentioned above, the Roman numeral is a form of numeric system that owes it origins to ancient Rome. Unlike its current form of 7 symbols, only three symbols were used: I, V, and X (1, 5, and 10 respectively) in the original forms. What the ancient Romans then did was to add 1 (I) as the number progressed.

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.

Ask Dr. Math FAQ: Roman Numerals, Roman numerals are a system of numerical notations used by the Romans. They are For example, the number 1732 would be denoted MDCCXXXII in Roman� Due to the limitations of the roman number system you can only convert numbers from 1 to 3999. To easily convert between roman and arabic numerals you can use the table above. The key is to handle one arabic digit at a time, and translate it to the right roman number, where zeroes become empty.

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

Roman Numerals -- from Wolfram MathWorld, Roman numerals are the letters that ancient Romans used as their numbers. It is thought that the numerals derived from "tally marks", being scratched lines used� Roman numerals are the numerical system used in ancient Rome. They use combinations of letters from the Latin alphabet to represent different values. Learning Roman numerals can help you write outlines, understand ancient Roman culture, and become a more cultured human being. Find out how to quickly master those tricky symbols after the jump.

Since KOMA-Script version 3.20 there are options to change the style of the TOC or list entries. You can use

\RedeclareSectionCommands[tocdynnumwidth]{chapter,section}

to get

or

\RedeclareSectionCommand[tocnumwidth=2.3em]{chapter}
\RedeclareSectionCommand[tocindent=2.3em,tocnumwidth=3.2em]{section}

Code:

\documentclass{scrreprt}[2016/05/10]% needs version 3.20 or newer
\RedeclareSectionCommand[tocnumwidth=2.3em]{chapter}
\RedeclareSectionCommand[tocindent=2.3em,tocnumwidth=3.2em]{section}
\renewcommand*\thechapter{\Roman{chapter}}

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

It is also possible to use package tocbasic (which is part of the KOMA-Script bundle) with a standard class. Then you can use

\usepackage{tocbasic}[2017/01/03]% needs version 3.22
\DeclareTOCStyleEntry[dynnumwidth]{tocline}{chapter}
\DeclareTOCStyleEntry[dynnumwidth]{tocline}{section}

or

\usepackage{tocbasic}[2016/05/10]
\DeclareTOCStyleEntry[numwidth=2.6em]{tocline}{chapter}
\DeclareTOCStyleEntry[indent=2.6em,numwidth=3.2em]{tocline}{section}

Code:

\documentclass{report}
\renewcommand*\thechapter{\Roman{chapter}}

\usepackage{tocbasic}[2016/05/10]
\DeclareTOCStyleEntry[numwidth=2.6em]{tocline}{chapter}
\DeclareTOCStyleEntry[indent=2.6em,numwidth=3.2em]{tocline}{section}

\begin{document}

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

Roman Numerals, Roman Numerals. roman Read on to learn about Roman Numerals or go straight to the Roman Numeral Conversion Tool. Which can be combined like this:� Answered October 28, 2017 · Author has 2.2K answers and 1.8M answer views Roman numerals are good for small integer quantities. Up to a few thousands, and can be fixed to work for millions or billions, but then, they become a little cumbersome. Roman numerals are good for adding and subtracting.

I'll provide an example of the use of titletoc for this problem. It requires loading the eqparbox package to have an automatic alignment of chapter titles, section titles, &c.:

\documentclass{report}
\usepackage[showframe, nomarginpar]{geometry} 
% Font Style
\usepackage{eqparbox}
\usepackage{titletoc}

\titlecontents{chapter}[0em]{\vspace{.25\baselineskip}}
{\eqparbox{ch}{\bfseries\thecontentslabel}\enspace}{}
{\hspace{.5em}\hfill\contentspage}

\titlecontents{section}[0em]{\vspace{.25\baselineskip}}
{\hskip\eqboxwidth{ch}{}\enspace\eqparbox{sec}{\thecontentslabel}\enspace}{}
{\hspace{.5em}\titlerule*[10pt]{$\cdot$}\contentspage}

\begin{document}

\renewcommand*\thechapter{\Roman{chapter}}
\tableofcontents
\setcounter{chapter}{6} % Problem starts at chapter 7
\chapter{Seven}
\chapter{Eight}
\section{Eight-one} \thesection\setcounter{section}{99}
\section{Eight-hundred}

\end{document} 

Roman Numerals, The position of the letters I, V, X, L, C, and D is what determines the value of the actual Roman numeral. An I in the wrong place can be the difference between 9� Order the Roman numerals either in increasing or decreasing order. Numbers used in Level 1 are from 1-39 and level 2 are 1-399. Convert Roman numerals into Arabic numbers for better understanding.

Roman Numerals - Reference, Learn how to convert between roman numerals and arabic numerals, and at a time, and translate it to the right roman number, where zeroes become empty. Roman numerals can be practised playing hopscotch, loop games, using input/output machines and number balances, as part of Venn diagrams and Carroll diagrams, to make magic squares, used as coordinates, for area and perimeter calculations, for codebreaking, exchanging money, playing calendar games, dice games, number snap, addition and subtraction grids and much more.

Roman Numerals, That seems to be used because it represents half of the M or 500. Again, written quickly it would become D. This inscription, found in Rome, reads� Roman numerals converter. Enter the Roman numeral or number and press the Convert button: Roman number: Convert: Decimal number: Convert: Calculation: Reset:

Roman numerals - history and use, In order to prevent numbers from becoming too long and cumbersome, the Romans also allowed for subtraction when a smaller numeral precedes a larger� This advanced level practice page includes Roman numerals with symbols I - M, or 1 - 1,000. Students write the Roman numerals in Arabic form, and vice-versa. Also includes three word problems.

Comments
  • For which class do you need a fix? A solution for scrreprt may be easier. A solution for report doesn't necessarily have to be the best for scrreprt.
  • @Stefan: someone once told me to always use standard classes for MWEs. I’m actually using screprt. I didn’t find a solution in the KOMA documentation, though.
  • if the problem is not depending on class features, a standard class MWE is fine. Here I just prefer a tiny class adjustment over a general package which is 1110 lines long and replaces many class macros, besides the TOC also for lists of tables and contents.
  • Of all the solutions here, this one probably plays nicest with KOMA. Oddly enough, it also resets the TOC style to "normal" so that the style explicitly needs to be reset to KOMA-like.
  • Wow! This is such a simple solution for a problem that tends to make your ToC really ugly when using roman numerals. Thank you @konrad-rudolph for adding it here! It saved a ton of hassle for me! Cheers!
  • I’m extremely wary of such low-level modifications since they (1) require an intimate knowledge of the classes that surpasses the documented features by far, and (2) is extremely fragile, i.e. not future-proof. Any minor change in the scrreprt class may break this code. This is also the reason why I usually abhor the concept of these super classes like KOMA and memoir (and, indeed, ConTeXt). A modular approach (as implemented by packages) is technically much more sound. Put differently, this problem showcases everything that’s wrong with the "architecture" of TeX. :-(
  • (That said, I’m grateful for the answer and I’ll probably use it.)
  • Please do not redefine \l@section this way with newer versions of KOMA-Script.
  • Wow. The titletoc documentation is really, really bad and I ended up using the (somewhat simpler, or at least more readably documented) tocloft package.
  • it is easy to say that a documentation is bad ... but it is really difficult to write a good one ;-)
  • true. But by that reasoning one can stifle all criticism – not really fair, is it?