我已经努力修复这个问题一段时间了。希望你们能帮我修复目录的这个小问题。
- 我希望常规章节有一个章节前缀
- 我希望附录章节仅具有“附录”前缀而不是“附录章节”前缀,如下所示。
我该如何解决这个问题?我尝试过许多复杂的解决方法,例如使用 \chapter* 并手动将条目添加到目录中,但这会弄乱章节格式,而且当我在主稿件中链接附录时,链接会丢失。所以我犹豫着是否要采用复杂的解决方法。有没有最小的干净解决方案可以让我重命名附录前缀?
问题和解决方案摘要
我的 thesis.sty 文件格式混乱。按照@Sveinung 的建议,在 STY 文件中找到了与章节定义相关的代码
\makeatletter \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect Chapter \numberline{\thechapter:} #1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
并对其进行了少许修改(即将“章节”替换为“附录”)并将其放在 Thesis.TEX 的 \appendix 命令下方,如下所示。
\appendix \makeatletter \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect Appendix \numberline{\thechapter:} #1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
答案1
要启动附录部分,请使用命令\appendix
,而不是环境。更改
\begin{appendices}
到
\appendix
并删除
\end{appendices}
如果你需要更多的灵活性,请加载 Will Robertson 和 Peter Wilson 的附录-包裹。
这是一个“MWE”,至少可以编译:
\documentclass[
11pt,
a4paper,
draft,
oneside]{book}
\pagestyle{plain}
\begin{document}
\fussy
\frontmatter
\typeout{Title}%
\title{title}
\maketitle%
\clearpage
\chapter*{}%
\label{ch:dedication}
\thispagestyle{empty}
\cleardoublepage%
\chapter{Acknowledgements}
\label{ch:acknowledgement}
\normalsize
\cleardoublepage%
\chapter{Abstract}
\index{Abstract}%
\typeout{Abstract}%
\cleardoublepage%
\mainmatter
\cleardoublepage%
\sloppy
\chapter{Introduction}
\label{ch:Intro}
\chapter[Constrained Motion and the Fundamental Equation]{Constrained Motion Approach and the Fundamental Equation of Mechanics}
\label{ch:Chapter2}
\chapter{Energy Control of Inhomogeneous Nonlinear Lattices}
\label{ch:Chapter3}
\chapter[Synchronization of Multiple Coupled Slave Gyroscopes]{Synchronization of Multiple Coupled Slave Gyroscopes with a Master Gyroscope}
\label{ch:Chapter4}
\chapter[Control of Hyperelastic Beams]{Control of Rubber-like Incompressible Hyperelastic Beams}
\label{ch:Chapter5}
\chapter{Conclusions and Future Work}
\label{ch:Chapter6}
%\backmatter
\cleardoublepage%
\appendix
\chapter[Energy is a positive definite function]{{Energy ${H}$ is a positive definite function}{Energy is a positive definite function}}
\label{A1}
\chapter[Explicit Closed Form Control Force]{{A Closed Form Expression for the Control Force ${F^C}$}{A Closed Form Expression for the Control Force}}
\label{A2}
\chapter[Origin is a single isolated fixed point]{{Origin $O$ is a unique and isolated equilibrium point}{Origin is a unique and isolated equilibrium point}}
\label{A3}
\chapter{{Set ${\Omega}$ is compact}{Omega set is compact}}
\label{A4}
\chapter[Sufficient Conditions on Actuator Placements]{{Actuator positions for which the only invariant set of ${\dot{q}_C \equiv 0}$ is the origin}{Sufficient Conditions on Actuator Placements}}
\label{A5}
\nocite{*}
\makeatletter
\makeatother
\interlinepenalty=10000
\bibliographystyle{acm}%
\bibliography{Chapters/reference}%
\addcontentsline{toc}{chapter}{\bibname}%
\end{document}