[Tex/LaTex] Solved – Table of Contents: Editing Appendix Prefix

appendicestable of contents

I have been struggling to fix this for a while now. I hope one of you could help me fix this tiny issue with table of contents.

  1. I want the regular chapters to have a Chapter prefix
  2. I want the appendix chapters to only have 'Appendix' prefix and NOT "Appendix Chapter" prefix as shown below.

Problem

How can I fix this issue? I've tried many complicated workarounds like using \chapter* and manually adding entry to table of contents, but this messes with chapter formatting and further when I link the appendix in the main manuscript, the link is lost. And so I am hesitant to go through the route of complicated workarounds. Are there any minimal clean solutions for me to rename appendix prefixes?

Summary of the Problem and Solution

My thesis.sty file was messing up the format. As @Sveinung suggested, found the code related to the chapter definition in the STY file

\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}

and modified it slightly (i.e. replaced "Chapter" with "Appendix") and placed it just below \appendix command of Thesis.TEX as shown below.

\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}

Best Answer

To start the appendices section, you use the command \appendix, not an environment. Change

\begin{appendices}

to

\appendix

and remove

\end{appendices}

If you need more flexibility, load Will Robert­son and Peter Wilson’s appendix-package.

Here is an ‘MWE’ something that at least compile:

\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}