已解決 - 目錄:編輯附錄前綴

已解決 - 目錄:編輯附錄前綴

我已經努力解決這個問題有一段時間了。我希望你們中的一個人可以幫我解決目錄中的這個小問題。

  1. 我希望常規章節有章節前綴
  2. 我希望附錄章節只有「附錄」前綴,而不是「附錄章節」前綴,如下所示。

問題

我該如何解決這個問題?我嘗試了許多複雜的解決方法,例如使用 \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}

並稍微修改它(即用“Appendix”替換“Chapter”)並將其放置在 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}

如果您需要更多靈活性,請加載威爾羅伯遜和彼得威爾遜的附錄-包裹。

這是一個至少可以編譯的「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}

相關內容