I have changed the default table of contents format:
\usepackage[titles]{tocloft}
\setlength{\cftbeforechapskip}{0pt}
\setcounter{tocdepth}{0}
\renewcommand{\cftchapfont}{\normalfont}
\renewcommand{\cftchappagefont}{\normalfont}
\renewcommand{\cftdotsep}{1}
\renewcommand{\cftchapleader}{\cftdotfill{\cftsecdotsep}}
the chapter now are no more in bold. Now I would like to have Table of Contents and Bibliography bold references :
\tableofcontents
\addcontentsline{toc}{chapter}{\bf{Bibliography}}
\addtocontents{toc}{\vspace{\normalbaselineskip}}
[...]
\printbibliography
\addtocontents{toc}{\vspace{\normalbaselineskip}}
\addcontentsline{toc}{chapter}{\bf{Bibliography}}
but this way the page number doesn't appear bold. How can I do to modify just the format of some voices?
EDIT
This is my MWE
\documentclass{book}
\usepackage{blindtext}
\usepackage[titles]{tocloft}
\setlength{\cftbeforechapskip}{0pt}
\setcounter{tocdepth}{0}
\renewcommand{\cftchapfont}{\normalfont}
\renewcommand{\cftchappagefont}{\normalfont}
\renewcommand{\cftdotsep}{1}
\renewcommand{\cftchapleader}{\cftdotfill{\cftsecdotsep}}
\begin{document}
\frontmatter
\tableofcontents
\addcontentsline{toc}{chapter}{\bf{Contents}}
\addtocontents{toc}{\vspace{\normalbaselineskip}}
\mainmatter
\Blinddocument
\backmatter
\chapter*{Bibliography}
\addtocontents{toc}{\vspace{\normalbaselineskip}}
\addcontentsline{toc}{chapter}{\bf{Bibliography}}
\end{document}
In the PDF, in the table of contents "Contents" and "Bibliography" are bold but not their pagenumbers. I would like also the pagenumbers to be bold
Best Answer
Temporary changes to the style of the fonts in
ToC
should be written to theToC
itself with\addtocontents{toc}{\begingroup\protect\renewcommand{...}{...}}
etc.I have defined a new command named
\addwithboldpagenumber
for this since there are two occurences of such additions, so there is some benefit of shorter code then.Also don't use the deprecated command
\bf
but\bfseries
or\textbf{}
.