2

I want to unbold the chapter name of the appendices in the toc, and only keep the appendix title/numbering bold. For example: "Appendix A supplementary materials for chapter 5". I used the solution from here Removing boldface from appendix chapters in TOC. I thought I could apply the unbold function to titletoc, but it doesn't work.

\documentclass{book}

\usepackage[titletoc,title]{appendix}

\usepackage{etoolbox}
\makeatletter
\g@addto@macro\appendices{%
  \addtocontents{titletoc}{\protect\patchcmd{\protect\l@chapter}{\bfseries}{}{}{}}
}
\makeatother

\begin{document}
\tableofcontents
\begin{appendices}

\chapter{Supplementary materials for Chapter 5}
\chapter{Supplementary materials for Chapter 6}

\end{appendices}
\end{document}

This is the original complied result

This is the result I intended to achieve

1 Answer 1

0

Try this

% apptocprob.tex  SE 589103
\documentclass{book}

\usepackage{comment}
\usepackage{tocloft}

\usepackage[titletoc,title]{appendix}

\begin{comment}
\usepackage{etoolbox}
\makeatletter
\g@addto@macro\appendices{%
  \addtocontents{titletoc}{\protect\patchcmd{\protect\l@chapter}{\bfseries}{}{}{}}
}
\makeatother
\end{comment}

\begin{document}
\tableofcontents

\chapter{First}

\begin{appendices}
%%% non-bold titles
\addtocontents{toc}{\protect
\renewcommand{\protect\cftchapaftersnumb}{\normalfont}
}
%%% non-bold page numbers
\addtocontents{toc}{\protect
\renewcommand{\protect\cftchappagefont}{\normalfont}
}

\chapter{Supplementary materials for Chapter 5}
\chapter{Supplementary materials for Chapter 6}

\end{appendices}
\end{document}

enter image description here

1
  • It works perfectly!!! thank you ;D
    – swell07
    Mar 26, 2021 at 19:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .