1

I would like to increasing the space between section number and title in the toc. I tried to solve the problem using \setlength\cftsectionnumwidth{ } but this does not work with the class scrbook.

\documentclass{scrbook}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}

\usepackage{tocloft}

\renewcommand\thesection{\arabic{section}}
\cftsetindents{section}{0pt}{15pt}
\cftsetrmarg{2cm}
\renewcommand{\cftdot}{}

\begin{document}
\tableofcontents
\chapter*{Chapter 1}
\section{Section 1}
\section{Section 2}
\section{Section 3}
\section{Section 4}
\end{document}
2

With tocloft (not recommended with a KOMA-Script class) the number width for the entries in TOC is set by the third argument of \cftindents. Assumnig the number width should be 50pt

\cftindents{section}{0pt}{50pt}

But you will get the same result using

\setlength\cftsecindent{0pt}
\setlength\cftsecnumwidth{50pt}

enter image description here

Code:

\documentclass{scrbook}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}

\usepackage{tocloft}

\renewcommand\thesection{\arabic{section}}
\cftsetindents{section}{0pt}{50pt}% <- changed
\cftsetrmarg{2cm}
\renewcommand{\cftdot}{}

\begin{document}
\tableofcontents
\addchap*{Chapter 1}
\section{Section 1}
\section{Section 2}
\section{Section 3}
\section{Section 4}
\end{document}

Suggestion without tocloft:

\documentclass{scrbook}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\renewcommand\thesection{\arabic{section}}

\RedeclareSectionCommand[
  tocindent=0pt,
  tocnumwidth=50pt,
]{section}

\RedeclareSectionCommands[
  toclinefill=\hfill
]{section,subsection,subsubsection,paragraph,subparagraph}
\makeatletter
\renewcommand{\@tocrmarg}{2cm}
\makeatother

\begin{document}
\tableofcontents
\addchap*{Chapter 1}
\section{Section 1}
\section{Section 2}
\section{Section 3}
\section{Section 4}
\end{document}

Because of a comment below: The headings of TOC, LOF and LOT are chapters by default (with a book class). So if you want to modify the font of the TOC title and the skip below the TOC title, you can use eg.

\BeforeTOCHead[toc]{%
  \addtokomafont{chapter}{\normalsize}
  \RedeclareSectionCommand[afterskip=1sp]{chapter}%
}

If you remove the optional argument, then the the titles of the lists (LOF and LOT) will change in the same way.

  • Is there also a command for \cfttoctitlefont and \cftaftertoctitleskip without tocloft? – GuestUser Mar 26 '18 at 11:45
  • See my updated answer. – esdd Mar 26 '18 at 12:03

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.