TransWikia.com

Romove boldface from chapter names of appendices in toc Latex

TeX - LaTeX Asked by swell07 on June 15, 2021

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@macroappendices{%
  addtocontents{titletoc}{protectpatchcmd{protectl@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

One Answer

Try this

% apptocprob.tex  SE 589103
documentclass{book}

usepackage{comment}
usepackage{tocloft}

usepackage[titletoc,title]{appendix}

begin{comment}
usepackage{etoolbox}
makeatletter
g@addto@macroappendices{%
  addtocontents{titletoc}{protectpatchcmd{protectl@chapter}{bfseries}{}{}{}}
}
makeatother
end{comment}

begin{document}
tableofcontents

chapter{First}

begin{appendices}
%%% non-bold titles
addtocontents{toc}{protect
renewcommand{protectcftchapaftersnumb}{normalfont}
}
%%% non-bold page numbers
addtocontents{toc}{protect
renewcommand{protectcftchappagefont}{normalfont}
}

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

end{appendices}
end{document}

enter image description here

Correct answer by Peter Wilson on June 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP