# Minor bugfixes and adjustments for the TOC of classicthesis

I am using classicthesis and prepared my document with parts, chapters and sections. This produces the following table of contents.

There are some details that I would like to fix:

1. Longer part numbers run into the part name. (highlighted in red)
2. I would like to manipulate the distance between subsequent chapter entries (highlighted in green). Thus, chapter entries followed by section entries should not be affected. (highlighted in yellow)
3. Part entries should have a dotted line as sections have.
4. The font size of the page number for parts, chapters and sections should be adjustable.

Last but not least, here is the MWE to test things out.

\documentclass[oneside, openright, titlepage, dottedtoc, numbers=noenddot,
paper=a4, fontsize=11pt, ngerman] {scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage[pdfspacing]{classicthesis}
\usepackage[dvipsnames]{xcolor}
\usepackage{lipsum,kantlipsum}

\hypersetup{
}
\begin{document}
\tableofcontents

\part{Bayern} \chapter{Muenchen} \chapter{Nuernberg}

\part{Berlin}
\chapter{Berlin}
\section{Charlottenburg-Wilmersdorf}\clearpage
\section{Friedrichshain-Kreuzberg}\clearpage
\section{Lichtenberg}\clearpage
\section{Marzahn-Hellersdorf}\clearpage
\section{Mitte}\clearpage
\section{Neukoelln}\clearpage
\section{Pankow}\clearpage
\section{Reinickendorf}\clearpage
\section{Spandau}\clearpage
\section{Steglitz-Zehlendorf}\clearpage
\section{Tempelhof-Schoeneberg}\clearpage
\section{Treptow-Koepenick}\clearpage

\part{Brandenburg} \chapter{Potsdam} \chapter{Cottbus}
\part{Bremen} \chapter{Bremen}
\part{Hamburg} \chapter{Hamburg}
\part{Mecklenburg-Vorpommern} \chapter{Schwerin} \chapter{Rostock}
\part{Niedersachsen} \chapter{Hannover} \chapter{Braunschweig}
\part{Nordrhein-Westfalen} \chapter{Duesseldorf} \chapter{Koeln}
\part{Rheinland-Pfalz} \chapter{Mainz} \chapter{Ludwigshafen}
\part{Saarland} \chapter{Saarbruecken}
\part{Sachsen} \chapter{Dresden} \chapter{Leipzig}
\part{Sachsen-Anhalt}\chapter{Magdeburg}\chapter{Halle}
\part{Schleswig-Holstein}\chapter{Kiel}\chapter{Luebeck}
\part{Thüringen} \chapter{Erfurt} \chapter{Jena}

\end{document}

-
Read the classicthesis manual before you are doing this. It breach with the package philosophy and intended layout. –  Sveinung Sep 8 '12 at 12:50
@Sveinung Sorry, but maybe I am using the package the wrong way. I opened a separate discussion on how to use classicthesis. –  JJD Sep 8 '12 at 13:40
A related (but IMO not duplicate) question about adjusting the TOC of classichesis. –  ThomasH Sep 25 '14 at 12:32

classicthesis internally uses the tocloft package to design the ToC, so you can easily achieve what you want; all you have to do is to play with

• \cftbeforechapskip to change vertical skip before chapters.
• \cftpartpagefont to change the font for part page numbers.
• \cftchappagefont to change the font for chapter page numbers.
• \cftsecpagefont to change the font for section page numbers.
• \cftpartdotsep to control the leaders for part entries.
• \cftpartaftersnumb to add space between part number.

A little example illustrating the use of those lenghts/commands:

\documentclass[oneside, openright, titlepage, dottedtoc, numbers=noenddot,
paper=a4, fontsize=11pt, ngerman] {scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage[pdfspacing]{classicthesis}
\usepackage[dvipsnames]{xcolor}
\usepackage{lipsum,kantlipsum}

\hypersetup{
}

\setlength{\cftbeforechapskip}{0.1em} % change vertical skip before chapters
\renewcommand{\cftpartpagefont}{\Large}% change the font for part page numbers
\renewcommand{\cftchappagefont}{\Large}% change the font for chapter page numbers
\renewcommand{\cftsecpagefont}{\Large}% change the font for section page numbers
}% change the font for part leader dots (not boldfaced)
\renewcommand{\cftpartaftersnumb}{\hspace*{0.5em}}% add space between part number and part title

\begin{document}
\tableofcontents

\part{Bayern} \chapter{Muenchen} \chapter{Nuernberg}

\part{Berlin}
\chapter{Berlin}
\section{Charlottenburg-Wilmersdorf}\clearpage
\section{Friedrichshain-Kreuzberg}\clearpage
\section{Lichtenberg}\clearpage
\section{Marzahn-Hellersdorf}\clearpage
\section{Mitte}\clearpage
\section{Neukoelln}\clearpage
\section{Pankow}\clearpage
\section{Reinickendorf}\clearpage
\section{Spandau}\clearpage
\section{Steglitz-Zehlendorf}\clearpage
\section{Tempelhof-Schoeneberg}\clearpage
\section{Treptow-Koepenick}\clearpage

\part{Brandenburg} \chapter{Potsdam} \chapter{Cottbus}
\part{Bremen} \chapter{Bremen}
\part{Hamburg} \chapter{Hamburg}
\part{Mecklenburg-Vorpommern} \chapter{Schwerin} \chapter{Rostock}
\part{Niedersachsen} \chapter{Hannover} \chapter{Braunschweig}
\part{Nordrhein-Westfalen} \chapter{Duesseldorf} \chapter{Koeln}
\part{Rheinland-Pfalz} \chapter{Mainz} \chapter{Ludwigshafen}
\part{Saarland} \chapter{Saarbruecken}
\part{Sachsen} \chapter{Dresden} \chapter{Leipzig}
\part{Sachsen-Anhalt}\chapter{Magdeburg}\chapter{Halle}
\part{Schleswig-Holstein}\chapter{Kiel}\chapter{Luebeck}
\part{Thüringen} \chapter{Erfurt} \chapter{Jena}

\end{document}


However, as Sveinung notes in his remark, the author of classicthesis carefully and intentionally designed the package to produce the intended layout, so one has to be careful not to break the overall design.

To prevent a single section entry from appearing in a page (as is the case for "Frankfurt", in the example) one can say

 \addtocontents{toc}{\protect\enlargethispage{\baselineskip}}


for example right after \chapter{Stuttgart}.

-
Argument accepted. Still some issues such as the missing space should be fixed. - 1) Can you please add how I could harmonize the size of the dots? 2 Is there a way to wrap TOC items to the next page so that in your example "Franfurt" is not left alone on the second page? - Thank you for your help. –  JJD Sep 13 '12 at 12:27
@JJD Can you please tell me which missing space are you talking about? Regarding your other requests, I updated my answer. –  Gonzalo Medina Sep 13 '12 at 13:54
I meant the space that I highlighted with the red color in my screenshot. - Thank you for the additional help! –  JJD Sep 13 '12 at 16:42
@JJD in my answer I added 0.5em with the line \renewcommand{\cftpartaftersnumb}{\hspace*{0.5em}}; if you need more spacing, use a larger length. Maybe I still don't get what space is causing the problem? –  Gonzalo Medina Sep 13 '12 at 16:58
You already solved the problem in the first attempt. I am totally happy. –  JJD Sep 13 '12 at 22:20