The command
Code: Select all
\renewcommand{\cftchapfont}{\normalfont}
I need to have one entry of my table of contents -- at the chapter level -- unbolded. Ideas?
I'm using a class built upon REPORT.
Keith
Code: Select all
\renewcommand{\cftchapfont}{\normalfont}
NEW: TikZ book now 40% off at Amazon.com for a short time.
Code: Select all
\addcontentsline{toc}{chapter}{\normalfont Some entry}
Code: Select all
\renewcommand{\cftchappagefont}{\normalfont}
Code: Select all
\documentclass{report}
\usepackage{tocloft}
\begin{document}
\tableofcontents
\chapter{One}
\section{One.One}
Text
\addtocontents{toc}{\string\let\string\cftchapfont\string\mdseries}
\addtocontents{toc}{\string\let\string\cftchappagefont\string\mdseries}
\addcontentsline{toc}{chapter}{Unbolded entry}
\addtocontents{toc}{\string\let\string\cftchapfont\string\bfseries}
\addtocontents{toc}{\string\let\string\cftchappagefont\string\bfseries}
\chapter{Two}
Text
\end{document}
Code: Select all
\begingroup
\renewcommand*\thepage{\textmd{\arabic{page}}}
\addcontentsline{toc}{chapter}{\textmd{Some entry}}
\endgroup
Code: Select all
\addtocontents{toc}{\string\let\string\cftchappagefont\string\mdseries}
\addcontentsline{toc}{chapter}{\mdseries Unbolded entry}
\addtocontents{toc}{\string\let\string\cftchappagefont\string\bfseries}
You're right, \protected@write redefines \thepage locally as unexpandable, so that it is expanded during the output routine. So you have to circumvent \addcontentsline and use \addtocontents:Juanjo wrote:phi,
I'm afraid that, in this case, your code doesn't work. The TOC just contains the page number, without any format that the redefinition of \thepage could apply.
Code: Select all
\addtocontents{toc}{\protect\contentsline{section}{\mdseries Some entry}{\mdseries\thepage}}
Code: Select all
\begingroup
\patchcmd\addcontentsline
{\contentsline{#2}{#3}{\thepage}}%
{\contentsline{#2}{#3}{\mdseries\thepage}}%
{\addcontentsline{toc}{section}{\texorpdfstring\mdseries{}Some entry}}%
{}
\endgroup
NEW: TikZ book now 40% off at Amazon.com for a short time.