1

In my table of contents, I observe that headings numbers nearly overlap titles of sections, as illustrated below.

enter image description here

What could I do to solve that? This is a MWE (a little bit long because I don't know exactly if I did not make any mistake) :

\documentclass[fontsize=12pt,%
               twoside=semi,%
               headings=small,%
               chapterprefix=true,%
               listof=flat]%
{scrbook}

\usepackage[utf8]{inputenc}
\usepackage [french]{babel}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
%\addtokomafont{disposition}{\rmfamily}
\stepcounter{secnumdepth}
\stepcounter{tocdepth}
\usepackage{url}
\usepackage{chronosys}
\usepackage{setspace}
%\onehalfspacing


\usepackage{chngcntr}
\counterwithout{footnote}{chapter}
%\usepackage[titles]{tocloft}

\usepackage{lipsum}


\usepackage[marginparsep=8pt,left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}


\newcounter{qcounter}


\usepackage{hyperref}

\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
\AtBeginDocument{\renewcommand{\thepart}{\Roman{part}}}


\date{}


\begin{document}

\frontmatter



\pagestyle{scrheadings}

\tableofcontents

\mainmatter

\part{Une partie}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}


\part{Une partie}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum


\part{Une partie}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}


\part{Une partie}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum


\part{Une partie}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum

\subsubsection{Une sous-sous-section}
\lipsum

\subsubsection{Une sous-sous-section}
\lipsum

\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum


\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum


\part{Une partie}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum


\part{Une partie}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\chapter{Un chapitre}
\lipsum
\section{Une section}
\lipsum
\subsection{Une sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum
\subsubsection{Une sous-sous-section}
\lipsum





\end{document}
3

The KOMA-Script classes load package tocbasic automatically. So it should be used to format the ToC and its entries. (Do not use tocloft! And package tocstyle will never leave the beta status, AFAIK it is not developed anymore.)

There are different ways to avoid the overlapping.

You could use option toc=flat:

\documentclass[fontsize=12pt,%
               twoside=semi,%
               headings=small,%
               chapterprefix=true,%
               listof=flat,%
               toc=flat,% <- added
              ]%
{scrbook}[2017/01/03]

\usepackage[utf8]{inputenc}
\usepackage [french]{babel}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}

\usepackage{blindtext}% only for dummy text
\usepackage[marginparsep=8pt,left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}

\usepackage{scrlayer-scrpage}

\usepackage{hyperref}

\setcounter{tocdepth}{\subsubsectiontocdepth}
\setcounter{secnumdepth}{\subsubsectionnumdepth}
\AtBeginDocument{\renewcommand{\thepart}{\Roman{part}}}

\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\part{Une partie}
\blindtext
\blinddocument
\setcounter{chapter}{33}% only for the example
\chapter{Un chapitre}
\blindtext
\setcounter{section}{17}% only for the example
\section{Une section}
\blindtext
\setcounter{subsection}{13}% only for the example
\subsection{Une sous-section}
\blindtext
\setcounter{subsubsection}{10}% only for the example
\subsubsection{Une sous-sous-section}
\blindtext
\end{document}

Run three times to get

enter image description here

Or you could use \RedeclareSectionCommands[tocdynnumwidth=true]{...}:

\documentclass[fontsize=12pt,%
               twoside=semi,%
               headings=small,%
               chapterprefix=true,%
               listof=flat,%
              ]%
{scrbook}[2017/01/03]
\RedeclareSectionCommands[tocdynnumwidth=true]
  {chapter,section,subsection,subsubsection}% <- added

\usepackage[utf8]{inputenc}
\usepackage [french]{babel}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}

\usepackage{blindtext}% only for dummy text
\usepackage[marginparsep=8pt,left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}

\usepackage{scrlayer-scrpage}

\usepackage{hyperref}

\setcounter{tocdepth}{\subsubsectiontocdepth}
\setcounter{secnumdepth}{\subsubsectionnumdepth}
\AtBeginDocument{\renewcommand{\thepart}{\Roman{part}}}

\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\part{Une partie}
\blindtext
\blinddocument
\setcounter{chapter}{33}% only for the example
\chapter{Un chapitre}
\blindtext
\setcounter{section}{17}% only for the example
\section{Une section}
\blindtext
\setcounter{subsection}{13}% only for the example
\subsection{Une sous-section}
\blindtext
\setcounter{subsubsection}{10}% only for the example
\subsubsection{Une sous-sous-section}
\blindtext
\end{document}

Run three times to get

enter image description here

Or you can adjust numwidth manuelly using **\RedeclareSectionCommand[tocnumwidth=...]{...}:

\documentclass[fontsize=12pt,%
               twoside=semi,%
               headings=small,%
               chapterprefix=true,%
               listof=flat,%
              ]%
{scrbook}[2017/01/03]
\RedeclareSectionCommand[tocnumwidth=2em]{chapter}% <- added
\RedeclareSectionCommand[tocnumwidth=3em]{section}% <- added
\RedeclareSectionCommand[tocnumwidth=4.1em]{subsection}% <- added
\RedeclareSectionCommand[tocnumwidth=5.3em]{subsubsection}% <- added

\usepackage[utf8]{inputenc}
\usepackage [french]{babel}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}

\usepackage{blindtext}% only for dummy text
\usepackage[marginparsep=8pt,left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}

\usepackage{scrlayer-scrpage}

\usepackage{hyperref}

\setcounter{tocdepth}{\subsubsectiontocdepth}
\setcounter{secnumdepth}{\subsubsectionnumdepth}
\AtBeginDocument{\renewcommand{\thepart}{\Roman{part}}}

\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\part{Une partie}
\blindtext
\blinddocument
\setcounter{chapter}{33}% only for the example
\chapter{Un chapitre}
\blindtext
\setcounter{section}{17}% only for the example
\section{Une section}
\blindtext
\setcounter{subsection}{13}% only for the example
\subsection{Une sous-section}
\blindtext
\setcounter{subsubsection}{10}% only for the example
\subsubsection{Une sous-sous-section}
\blindtext
\end{document}

Run two times to get:

enter image description here

2

As you're using a KOMA-Script class you should not use tocloft. tocloft should give you a warning if you load it with KOMA.

Usually you're done with toc=flat. But you should consider to compile multiple times.

Another option: tocstyle, which is currently (and probably forever) beta, is part of the KOMA bundle.

  • @esdd You're right, toc=flat was the option. – TeXnician Jun 12 '17 at 4:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.