1

I am trying to display the appendix in my thesis TOC as

Appendix A

instead of

Chapter A

using our university's class file 'kfupm_thesis.cls'. Here is the MWE

\documentclass[ms, 12pt]{kfupm_thesis}

\begin{document}

\tableofcontents

\chapter{First Chapter}
\section{BLA}
\subsection{BLA-BLA}

\chapter{Second Chapter}
\section{BLA}
\subsection{BLA-BLA}

\appendix
\chapter{Parameters}
\section{BLA}
\subsection{BLA-BLA}

\end{document}

I believe that the segment of code inside the 'kfupm_thesis.cls' file responsible for printing the appendix through the \appendix command is as follows (lines 581-585 and line 784):

\newcommand\appendix{\par   % line 581
  \setcounter{chapter}{0}% 
  \setcounter{section}{0}%
  \gdef\@chapapp{\appendixname}%
  \gdef\thechapter{\@Alph\c@chapter}}

\newcommand\appendixname{APPENDIX} % line 784

Going over this code, I think that the \appendix command should print the chapter header as APPENDIX instead of CHAPTER in TOC. However, it is not doing so. I checked the post at here but did not help me. I also tried using the appendix package but then with using the \begin{appendices} and \end{appendices} instead of \appendix and using the \chapter command, the output is like

APPENDIX CHAPTER A

The class file can be obtained from this dropbox link, needed to run MWE. Is there any way I can have the \appendix command to print APPENDIX in the TOC. Any help will be greatly appreciated. Thanks a lot.

P.S. I apologize for the lengthy class file, but I think that going over the mentioned lines of code may help identify the issue.

1 Answer 1

3

Easy to do with the etoolboxand apptools packages:

\documentclass[ms, 12pt]{kfupm_thesis}
\usepackage{apptools, etoolbox}

\makeatletter
\patchcmd{\@chapter}{\protect {CHAPTER }}{\ifappendix{APPENDIX }\else{CHAPTER }\fi}{}{}
\makeatother

\begin{document}

\tableofcontents

\chapter{First Chapter}
\section{BLA}
\subsection{BLA-BLA}

\chapter{Second Chapter}
\section{BLA}
\subsection{BLA-BLA}

\appendix
\chapter{Parameters}
\section{BLA}
\subsection{BLA-BLA}

\end{document} 

enter image description here

4
  • Can you take a look at this question. It is related but addresses a different issue. tex.stackexchange.com/questions/288762/…
    – Adeel
    Commented Jan 21, 2016 at 18:03
  • @Bernard Very regrettably, it does not work for me: the Appendices are called Chapters in the TOC. The pdf and the source of the magnum opus can be both found at (freemathtexts.org/InProgress/RAFv7.1)
    – schremmer
    Commented May 13, 2016 at 23:37
  • @schremmer: I'll try to understand why it doesn't this week-end.
    – Bernard
    Commented May 14, 2016 at 0:32
  • @Bernard Thanks very much but please do it at your best convenience as there is zero urgency.
    – schremmer
    Commented May 14, 2016 at 0:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .