In the table of contents, I want the chapters to appear like
Chapter 1: Preface
and
Chapter 4: Advanced Topics
I tried to modify the \l@chapter
command as shown in the MWE but what I get is actually
Chapter 1 Preface:
How to fix it?
I want to do it without titletoc
or tocloft
.
\documentclass{book}
\makeatletter
\renewcommand*\l@chapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip 1.0em \@plus\p@
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
Chapter #1:\nobreak\hfil % <<<--- Changed
\nobreak\hb@xt@\@pnumwidth{\hss #2%
\kern-\p@\kern\p@}\par
\penalty\@highpenalty
\endgroup
\fi}
\begin{document}
\tableofcontents
\chapter{Preface}
\end{document}