I have a document with both numbered and unnumbered chapters. To distinguish them from each other in the TOC I would like the unnumbered chapters to be in italic. My MWE works on the chapter title - how can I format the corresponding page number in italic?
Also, is it possible to centre the Part 1 entry?
\documentclass[a4paper, 12pt]{report}
\usepackage[titles]{tocloft}
\begin{document}
\tableofcontents
\part{Part 1}
\chapter{Numbered chapter}
\chapter*{Unnumbered chapter}
\addcontentsline{toc}{chapter}{\textit{Unnumbered chapter}}
\end{document}
You can write what is naturally done by
\addcontentsline
manually using\addtocontents{toc}
:The above should work for
\chapter
s since they are typically set on a new page and therefore\thepage
would result in the correct value. However, it does not work withhyperref
.Alternatively, define a new type of ToC-entry called
chapterstar
:The above solution works with
hyperref
and is more generic.