3

I'm using the document class hausarbeit-jura (a document class for jura student papers).

The number of my 8th section (roman numbering "VIII") overlaps with the title of the section in the table of contents.

I already had a look at Overlapping numbers and titles in toc but when I add \addtolength{\cftsecnumwidth}{10pt} to my document I get the error message:

Undefined control sequence \addtolength{\cftsecnumwidth}{10pt}
Missing number, treated as zero \section
Illegal unit of measure (pt inserted) \section

Minimal working example:

\documentclass[12pt,utf8,headline,headlinetitlepageleft,nosuperscriptedition]{hausarbeit-jura}

\begin{document}
\tableofcontents
\addtolength{\cftsecnumwidth}{10pt}
\section{TEXT}
\section{TEXT}
\section{TEXT}
\section{TEXT}
\section{TEXT}
\section{TEXT}
\section{TEXT}
\section{TEXT}
\section{TEXT}

\end{document}

Result looks like this: enter image description here

Any ideas how to fix this? Thanks to everyone in advance! :-)

3
  • 1
    Did you compile twice? For \cftsecnumwidth you need another package (tocloft iirc).
    – TeXnician
    Commented Jun 3, 2018 at 14:10
  • Yes, I was missing the package! Thanks so far! Now my subthree, subfour and other sections are not intended correctly. I will try it myself first.
    – Yeti
    Commented Jun 3, 2018 at 14:19
  • No need to load tocloft. You can use \AtBeginDocument{\sectionnumwidth=2cm} somewhere in your preamble. Same should be true for other levels.
    – Skillmon
    Commented Jun 3, 2018 at 15:43

1 Answer 1

6

The class does

\settowidth{\sectionnumwidth}{III.\ }

which is insufficient for accommodating VIII. You can use VIII instead.

%\UseRawInputEncoding % uncomment for TeX Live 2018

\documentclass[
  12pt,
  utf8,
  headline,
  headlinetitlepageleft,
  nosuperscriptedition
]{hausarbeit-jura}

\AtBeginDocument{\settowidth{\sectionnumwidth}{VIII.\ }}

\begin{document}
\tableofcontents
\section{TEXT}
\section{TEXT}
\section{TEXT}
\section{TEXT}
\section{TEXT}
\section{TEXT}
\section{TEXT}
\section{TEXT}
\section{TEXT}

\end{document}

The first line should be uncommented if TeX Live 2018 (more precisely LaTeX 2018-04-01), as the class has not yet been updated for UTF-8 support by default.

enter image description here

1
  • That solved the problem. Thank you very much!
    – Yeti
    Commented Jun 3, 2018 at 21:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .