我想取消附录列表中附录名称的粗体显示。该怎么做?
这是我的代码:
\documentclass[a5paper,11pt]{book}
\usepackage[margin=1.5cm, inner=2.5cm]{geometry}
\usepackage{times}
\usepackage{tocbasic}
\newcommand\listappendixname{List of Appendices}
\newcommand\appcaption[1]{%
\addcontentsline{app}{chapter}{#1}}
\makeatletter
\newcommand\listofappendices{%
\chapter*{\listappendixname}\@starttoc{app}
}
\makeatother
\DeclareTOCStyleEntry[
linefill=\bfseries\TOCLineLeaderFill,
beforeskip=0pt,
entrynumberformat=\chapterprefixintoc,
dynnumwidth
]{tocline}{chapter}
\newcommand*\chapterprefixintoc[1]
{\MakeUppercase{\chaptername}~#1\enskip}
\makeatletter
\AtBeginDocument{%
\DeclareTOCStyleEntry[%
indent=\ifundefinedorrelax{scr@dte@chapter@lastmaxnumwidth}
{1.5em}
{\scr@dte@chapter@lastmaxnumwidth}%
]{tocline}{section}
\DeclareTOCStyleEntry{tocline}{subsection}
}
\makeatother
\begin{document}
\tableofcontents
\listofappendices
\addcontentsline{toc}{chapter}{List Of Appendices}
\chapter{Chapter one}
\chapter{Chapter two}
\appendix
\chapter{Appendix one}\appcaption{Appendix one}
...(contents of appendix one)...
\chapter{Appendix two}\appcaption{Appendix two}
...(contents of appendix two)...
\end{document}
答案1
对于附录列表,在代码中添加 \textnormal 会取消列表中附录名称的粗体:
\newcommand\appcaption[1]{%
\addcontentsline{app}{chapter}{\textnormal{#1}}} % added textnormal.
对于点,您可以按如下方式删除 \textbf,但它会使整个内容中的点变为非粗体:
\DeclareTOCStyleEntry[
linefill=\TOCLineLeaderFill, % removed \textbf
结果如下:
更新答案
这完全取代了上述部分解决方案。更新后的答案用于\DeclareNewTOC
格式化附录列表。以下是显示纯格式文本的结果:
\documentclass[a5paper,11pt]{book}
\usepackage[margin=1.5cm, inner=2.5cm]{geometry}
\usepackage{times}
\usepackage{tocbasic}
\newcommand\listappendixname{List of Appendices}
\newcommand\appcaption[1]{%
\addcontentsline{app}{appendixlist}{#1}} <-----% uses new toc style
\makeatletter
\newcommand\listofappendices{%
\chapter*{\listappendixname}\@starttoc{app}
}
\makeatother
\DeclareTOCStyleEntry[
linefill=\TOCLineLeaderFill,
beforeskip=0pt,
entrynumberformat=\chapterprefixintoc,
dynnumwidth
]{tocline}{chapter}
\DeclareNewTOC[ %<----- new style definition for appendix list.
tocindent=0em,
tocentrystyle=tocline,
tocentrylinefill=\TOCLineLeaderFill,
]{appendixlist}
\newcommand*\chapterprefixintoc[1]
{\MakeUppercase{\chaptername}~#1\enskip}
\makeatletter
\AtBeginDocument{%
\DeclareTOCStyleEntry[%
indent=\ifundefinedorrelax{scr@dte@chapter@lastmaxnumwidth}
{1.5em}
{\scr@dte@chapter@lastmaxnumwidth}%
]{tocline}{section}
\DeclareTOCStyleEntry{tocline}{subsection}
}
\makeatother
\begin{document}
\tableofcontents
\listofappendices
\addcontentsline{toc}{chapter}{List Of Appendices}
\chapter{Chapter one}
\chapter{Chapter two}
\appendix
\chapter{Appendix one}\appcaption{Appendix one}
...(contents of appendix one)...
\chapter{Appendix two}\appcaption{Appendix two}
...(contents of appendix two)...
\end{document}
答案2
我希望这有帮助:
\documentclass[a5paper,11pt]{book}
\usepackage[margin=1.5cm, inner=2.5cm]{geometry}
\usepackage{times}
\usepackage{tocbasic}
\newcommand\listappendixname{List of Appendices}
\newcommand\appcaption[1]{%
\addcontentsline{app}{chapter}{\textnormal{#1}}}
\makeatletter
\newcommand\listofappendices{%
\chapter*{\listappendixname}\@starttoc{app}
}
\makeatother
\DeclareTOCStyleEntry[
linefill=\TOCLineLeaderFill,
beforeskip=0pt,
entrynumberformat=\chapterprefixintoc,
dynnumwidth
]{tocline}{chapter}
\newcommand*\chapterprefixintoc[1]
{\MakeUppercase{\chaptername}~#1\enskip}
\makeatletter
\AtBeginDocument{%
\DeclareTOCStyleEntry[%
indent=\ifundefinedorrelax{scr@dte@chapter@lastmaxnumwidth}
{1.5em}
{\scr@dte@chapter@lastmaxnumwidth}%
]{tocline}{section}
\DeclareTOCStyleEntry{tocline}{subsection}
}
\makeatother
\begin{document}
\tableofcontents
\listofappendices
\addcontentsline{toc}{chapter}{List Of Appendices}
\chapter{Chapter one}
\chapter{Chapter two}
\appendix
\chapter{Appendix one}\appcaption{Appendix one}
...(contents of appendix one)...
\chapter{Appendix two}\appcaption{Appendix two}
...(contents of appendix two)...
\end{document}
这将为您提供: