过去几个月我一直在撰写我的博士论文。我从模板开始,但根据我的需求逐渐添加了许多包和代码片段。最近我注意到附录列表不起作用。
以下是我序言中的部分内容,来自一个我不认识的研究生 5 年前建立的模板。我从以下网址下载的所有文档本网站。
\documentclass[12pt,twoside]{report}
\usepackage{appendix}
\usepackage{graphicx}
\graphicspath{ {Images/} }
\usepackage{amsmath}
\usepackage{txfonts}
\usepackage{lipsum}
\usepackage{textcomp}
\usepackage{tocloft}
\usepackage{csquotes}
\usepackage{adjustbox}
\usepackage[backend=bibtex,style=verbose,
bibencoding=ascii,
citestyle=authoryear,doi=false,url=false,isbn=false]{biblatex}
\addbibresource{thesis}
\usepackage{setspace}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{booktabs}
\usepackage{float}
\usepackage{stackengine}
\usepackage[bottom]{footmisc}
\usepackage{titlesec}
\usepackage{epigraph}
\usepackage{times}
\usepackage{microtype}
\usepackage{xcolor}
\makeatletter
\usepackage{hyperref}
接下来,序言定义了论文页面样式,设置了页面布局,定义了边距,并定义了章节题词的样式。接下来,我们有来自模板作者的以下说明:
\begin{document}
%% *** NOTE ***
%% You should put all of your '\newcommand', '\newenvironment', and
%% '\newtheorem's (in other words, all the global definitions that you
%% will need throughout your thesis) in a separate file and use
\input{commands}
因此下面我将修改其中一些命令,但如果需要,我可以提供任何内容。
\numberwithin{figure}{chapter}
\newenvironment{acknowledgements}%
%<details omitted>
\newenvironment{dedication}%
%<details omitted>
\newenvironment{preliminary}%
%<details omitted>
\newcommand{\qed}
%<details omitted>
\newcommand\isjoint[1]
%<details omitted>
\newcommand\isalt[1]
%<details omitted>
\newcommand\isdefinedsig[1]
%<details omitted>
\newcommand\isdefinedspinetitle[1]
%<details omitted>
\newcommand\coauthor[1]
%<details omitted>
\newcommand\acknowlege[1]
%<details omitted>
%<Next, about 20 lines define functions for the names of the supervisory committee and examination committe>
\newcommand{\makecoauthor}{
Type information about coauthorship here/}
\newcommand{\makeacknowlege} {
Type in acknowlegements here
} %These commands make space for a co-authorship statement and the acknowledgements.
%%%Here's where things get interesting:
\newcommand{\listappendixname}{List of Appendices}
\newlistof{myappendices}{app}{\listappendixname}
\newcommand{\myappendices}[1]{}%
\addcontentsline{app}{myappendices}{#1}\par}
%Illegal parameter number in definition of \reserved@a.
%<to be read again>
% 1
%l.125 \addcontentsline{app}{myappendices}{#1}
% \par}
%You meant to type ## instead of #, right?
%Or maybe a } was forgotten somewhere earlier, and things
%are all screwed up? I'm going to assume that you meant ##.
%
%! Too many }'s.
%l.125 \addcontentsline{app}{myappendices}{#1}\par}
%<The rest of these commands set up the template for the title page and examination certificate.>
我之所以包含上述详细信息,是因为我的问题与附录列表有关。
\begin{preliminary}
%% This generates the title page from the information given above.
\maketitle
\addcontentsline{toc}{chapter}{Certificate of Examination}
\makecert
\newpage
\addcontentsline{toc}{chapter}{Co-Authorship Statement}
%\coauthor{\makecoauthor} %comment this out if none
%\newpage
%\addcontentsline{toc}{chapter}{Acknowlegements}
%\acknowlege{\makeacknowlege} %as above
\addcontentsline{toc}{chapter}{Abstract}
\Large\begin{center}\textbf{Abstract}\end{center}\normalsize
%% *** Put your Abstract here. ***
%% (150 words for M.Sc. and 350 words for Ph.D.)
This is a really silly abstract.
\vfill
\textbf{Keywords:} Time series analysis, data mining
\newpage
\tableofcontents\newpage
\newpage
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
\newpage
\addcontentsline{toc}{chapter}{List of Tables}
\listoftables\newpage
以下是重点部分:
\addcontentsline{toc}{chapter}{List of Appendices}
\listofmyappendices\newpage
%I've left the rest in for good measure.
\addcontentsline{toc}{chapter}{List of Abbreviations, Symbols, and Nomenclature}
\large List of Abbreviations, Symbols, and Nomenclature \normalsize
\newpage
\end{preliminary}
正文的相关部分是如何插入附录的说明:
%Appendices.
\begin{appendices}
\input{AppendixA}
\input{AppendixB}
\input{AppendixC}
\input{AppendixD}
\end{appendices}
有人能指出是什么原因导致附录列表不起作用吗?
答案1
错误最有可能出现在这两行:
\newcommand{\myappendices}[1]{}%
\addcontentsline{app}{myappendices}{#1}\par}
而模板(见西方论题) 有
\newcommand{\myappendices}[1]{%
\addcontentsline{app}{myappendices}{#1}\par}
IE 的外侧右侧}
不\newcommand{\myappendices}[1]{%
应该存在。