I'm currently writing a LaTeX document in the book documentclass. In my ToC I want the actual titles of certain entries (parts in my case) to come in a newline after a generic name of the section-type ('Part') followed by the number ('I', 'II', …), so it should look like this:
Part I
Title of first part
Part II
Title of second part
I'm using the tocloft package to customize the ToC and its manual actually has an example that excactly describes how to achieve this. Apparently, for whatever reason, the newline command (see MWE) has no effect with the book class. Any suggestions on what is the problem here?
\documentclass{book}
\usepackage{tocloft}
\renewcommand{\cftpartpresnum}{\partname\ }
\renewcommand{\cftpartaftersnumb}{\\ }
\begin{document}
\tableofcontents
\part{Title of first part}
\part{Title of second part}
\end{document}
EDIT 1:
I've followed @locksteps advice and tried to implement a solution with the titletoc
package. However, now I'm stuck with the problem that for part entries for whatever reason the lablenummer is always attached to the actual title, for chapter and so on one can call the label independently
\documentclass{book}
\usepackage{titletoc}
\titlecontents{part}[0pt]{}{}{\Large\bfseries Part\\*}{}[]
\titlecontents{chapter}[0pt]{}{Chapter \thecontentslabel\\*}{}{}[]
\begin{document}
\tableofcontents
\part{The first part}
\chapter{The first chapter}
\end{document}
Best Answer
tocloft
s\cftXaftersnumb
macro family doesn't work forX
=part
in thebook
class. Quoting from thetocloft
manual, p. 9: