Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

TOC

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, 
headinclude, footinclude=true, cleardoublepage=empty, abstractoff, BCOR=5mm, 
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{
    colorlinks=true,      % false: boxed links; true: colored links.
    linktocpage=true,     % Moves the clickable link to the page numbers.
    linkcolor=OliveGreen  % Color of internal links.
}
\begin{document}
\tableofcontents

\part{Baden-Württemberg} \chapter{Stuttgart} \chapter{Mannheim}
\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{Hessen} \chapter{Wiesbaden} \chapter{Frankfurt}
\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}
share|improve this question
    
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
add comment

1 Answer

up vote 2 down vote accepted

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, 
headinclude, footinclude=true, cleardoublepage=empty, abstractoff, BCOR=5mm, 
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{
    colorlinks=true,      % false: boxed links; true: colored links.
    linktocpage=true,     % Moves the clickable link to the page numbers.
    linkcolor=OliveGreen  % Color of internal links.
}

\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
\renewcommand{\cftpartdotsep}{\cftdotsep}% add leaders for part entries
\renewcommand{\cftpartleader}{\normalfont\normalsize\cftdotfill{\cftpartdotsep}
}% 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{Baden-Württemberg} \chapter{Stuttgart} \chapter{Mannheim}
\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{Hessen} \chapter{Wiesbaden} \chapter{Frankfurt}
\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}

enter image description here

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}.

share|improve this answer
    
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
1  
@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
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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