I need to customize the appearance of my table of contents according to the requirements of a publisher.
Here is a minimal example of what it looks like right now:
\documentclass{scrbook}
\begin{document}
\frontmatter
\tableofcontents
\chapter{Preface}
\mainmatter
\part{First part}
\chapter{First chapter}
\section{First section}
\subsection{First subsection}
\subsection{Second subsection}
\section{Second section}
\chapter{Second chapter}
\end{document}
This produces something that looks like this:
Now my publisher requested that the chapter titles should have dots between title and page number.
I have found the tocstyle
package, but I don't understand its documentation. I am not even sure the package lets me do what I need to do. Can somebody please make suggestions on how to get what I want? Thanks.
Edit: I need to remove the part page numbers as well. I posted this requirement in my original question, but multiple questions per thread were discouraged. However, later it turned out that this can actually make a difference also for the question asked here: If I use tocstyle
to suppress page part numbers, this may affect the solutions posted here to get rid of the chapter dots.
Best Answer
Do not use package
tocloft
(mentioned in your own answer) together with a KOMA-Script class.There is an KOMA-Script option to fill the space between the chapter title and the pagenumber in TOC with dots:
If the page numbers for the chapter headings should not be bold use
It is also possible to remove the page number for the part headings from TOC:
Code:
It is also possible to use package
tocstyle
which is part of the KOMA-Script bundle. To get dots between the headings off all levels and the page numbers in TOC useas already suggested by @Peter Ebelsberger. To remove the dots and the page numbers for the part headings in TOC add
MWE:
Run several times to get