我想取消目录中附录章节名称的粗体显示,只保留附录标题/编号的粗体显示。例如:“附录 A第 5 章的补充材料”。我使用了此处的解决方案删除目录中附录章节的粗体字样。我以为我可以将 unbold 函数应用于 titletoc,但是它不起作用。
\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}
答案1
尝试这个
% 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}