答案1
在您的main.tex
,您可以使用
%----------------------------------------------------------------------------------------
% THESIS CONTENT - APPENDICES
%----------------------------------------------------------------------------------------
\cleardoublepage
\phantomsection
\appendix % Cue to tell LaTeX that the following 'chapters' are Appendices
\addtocontents{toc}{\vspace{2em}} % Add a gap in the Contents, for aesthetics
\addcontentsline{toc}{chapter}{Appendices}
% Include the appendices of the thesis as separate files from the Appendices folder
% Uncomment the lines as you write the Appendices
\let\oldchapter\chapter
\renewcommand{\chapter}[1]{%
\refstepcounter{chapter}%
\oldchapter*{Appendix \thechapter: #1}%
\addcontentsline{toc}{chapter}{\texorpdfstring
{\makebox[1.5em][l]{\thechapter}}% in main document
{\thechapter\space}#1}% in PDF bookmarks
}
\apptocmd{\backmatter}{\let\chapter\oldchapter}{}{}
\chapter{First appendix}
\section{A section}
\section{Another section}
\chapter{Second appendix}
\section{A section}
\section{Another section}
\chapter{Third appendix}
\section{A section}
\section{Another section}
上述定义插入Appendices
到 ToC 中以匹配 的格式\chapter
。后续的\chapter
s 被强制匹配\chapter*
并在 处更正\backmatter
。我已在上述代码中逐字插入\chapter
s 和s ,但您可以按照模板中的建议通过包含它们。\section
\input
附录在文档和目录中的\chapter
标题为。使用允许正确设置生成 PDF 的书签。Appendix X: <title>
X <title>
\texorpdfstring{<TeX>}{<PDF>}