book
class), and am using the tocloft package to make my table of contents pretty. I would like to add a horizontal line beneath each Part section of the ToC, but here I run into a problem. I use this to add an
\hrule
after each part entry, and this looks great.
Code: Select all
\renewcommand{\cftpartafterpnum}{\cftparfillskip\\[-12pt]\hrule}
Here is a minimal example showing what happens:
Code: Select all
\documentclass{book}
\usepackage{tocloft}
\renewcommand{\cftpartafterpnum}{\cftparfillskip\\[-12pt]\hrule}
\begin{document}
\tableofcontents
\clearpage
\part{bla}
\section{bla}
\part{bla}
\section{bla}
\part{bla}
\section{bla}
\part{bla}
\section{bla}
\part{bla}
\section{bla}
\part{bla}
\section{bla}
\part{bla}
\section{bla}
\part{bla}
\section{bla}
\part{bla}
\section{bla}
\part{bla}
\section{bla}
\part{bla}
\section{bla}
\part{bla}
\section{bla}
\section{bla}
\end{document}
I know it should be possible to fill in extra space in the ToC here and there, when I get closer to finishing the thesis and know how the sections will actually be positioned on the contents pages, but it would be really nice for this to simply happen automatically.
