7

I would like to have no dotted line between the sections and the page number (like for chapters). The switch I have included seem not to work (but it works for the chapter: I can have dotted lines if I set it to true). What is wrong?

\documentclass{scrbook}
\KOMAoptions{paper=156mm:234mm, BCOR=8mm,twoside,
    headinclude=false, footinclude=false, 
    headings=normal,
    chapterentrydots=false,  % default
    sectionentrydot=false,
    }

\begin{document}

\tableofcontents

\chapter{one}
\section{oneone}
\end{document}

enter image description here

user855443
  • 1,120

2 Answers2

12

Option sectionentrydots is provided by class scrartcl, but not by the classes with chapters.

But you can use \RedeclareSectionCommand:

\RedeclareSectionCommand[
  toclinefill=\hfill
]{section}

Example:

\documentclass{scrbook}
\KOMAoptions{paper=156mm:234mm, BCOR=8mm,twoside,
    headinclude=false, footinclude=false, 
    headings=normal,
    chapterentrydots=false,  % default
    }
\RedeclareSectionCommand[
  toclinefill=\hfill
]{section}

\begin{document}
\tableofcontents
\chapter{one}
\section{oneone}
\end{document}

Result:

enter image description here

Note that there is also \RedeclareSectionCommands:

\RedeclareSectionCommands[
  toclinefill=\hfill
]{section,subsection}

Then both sections and subsections do not get the dotted line in TOC.

esdd
  • 85,675
3

You can redefine the command responsible for the leaders:

\documentclass{scrbook}

\KOMAoptions{
  paper=156mm:234mm,
  BCOR=8mm,twoside,
  headinclude=false,
  footinclude=false,
  headings=normal,
}

\renewcommand\TOCLineLeaderFill[1][]{\hfill}

\begin{document}

\tableofcontents

\chapter{one}
\section{oneone}

\end{document}

enter image description here

For finer control, you can load the tocbasic package (part of the KoMa-script bundle) and use \DeclareTOCStyleEntry.

egreg
  • 1,121,712
  • 1
    You don't need to explicitly load tocbasic to use \DeclareTOCStyleEntry, because KOMA-Script classes already load tocbasic. – Schweinebacke Jul 13 '18 at 07:12