You can write what is naturally done by \addcontentsline
manually using \addtocontents{toc}
:

\documentclass{report}
\usepackage[titles]{tocloft}
\begin{document}
\tableofcontents
\chapter{Numbered chapter}
\chapter*{Unnumbered chapter}
\addtocontents{toc}
{\protect\contentsline{chapter}{\textit{Unnumbered chapter}}{\textit{\thepage}}}
\end{document}
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 with hyperref
.
Alternatively, define a new type of ToC-entry called chapterstar
:
\documentclass{report}
\usepackage[titles]{tocloft}
\usepackage{etoolbox}
\makeatletter
\let\l@chapterstar\l@chapter
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\l@chapterstar}{\cftchapfont}{\cftchapstarfont}{}{}% Insert starred chapter font
\patchcmd{\l@chapterstar}{#2}{\cftchapstarpagefont #2}{}{}% Insert starred chapter page number font
\makeatother
\newcommand{\cftchapstarfont}{\cftchapfont\itshape}
\newcommand{\cftchapstarpagefont}{\cftchappagefont\itshape}
\begin{document}
\tableofcontents
\chapter{Numbered chapter}
\chapter*{Unnumbered chapter}
\addcontentsline{toc}{chapterstar}{Unnumbered chapter}
\end{document}
The above solution works with hyperref
and is more generic.