3

According to other answers here and elsewhere on the Internet, to add "Part" before the part number in the ToC you do this:

\usepackage{tocloft}
\renewcommand\cftpartpresnum{Part~}

However, I've spent two hours trying to figure out why it doesn't work for me and eventually found that it's because I'm using the titlesec package. Here is a MWE that shows the problem:

\documentclass{book}

\usepackage{titlesec}
\usepackage{tocloft}
\renewcommand\cftpartpresnum{Part~}

\begin{document}

\tableofcontents

\part{Beginnings}

\chapter{Things}
\chapter{More Things}

\end{document}

Removing the \usepackage{titlesec} fixes it.

Given that I am using titlesec to style chapter and section titles, how do I add the "Part~" text before the part-number in the ToC?

1 Answer 1

5

You want to avoid using both titletoc/titlesec and tocloft. Choose one or the other. Here is a model you can adapt.

\documentclass{book}

\usepackage{titlesec,titletoc}
%\usepackage{tocloft}
%\renewcommand\cftpartpresnum{Part~}

\titlecontents{part}%
[0pt]{\sffamily\bfseries\large\protect\addvspace{15pt}\titlerule\addvspace{1.5ex}}%remove rule if you like
{}{\partname~}
{\hfill\contentspage}%replaced with {} if don't want page number for parts
[\addvspace{0.7ex}\titlerule\addvspace{1.5ex}]%remove rule if you like

\begin{document}

\tableofcontents

\part{Beginnings}

\chapter{Things}
\chapter{More Things}

\end{document}
2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .