# Changing “Chapter A” to “Appendix A” in TOC

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

Appendix A

Chapter A

using our university's class file 'kfupm_thesis.cls'.

The same question was asked and answered here. But in my case I want to add appendices chapter wise so if I use command "\appendix", the numbering of subsequent chapters changes to alphabetical. That's why I think I have to use "\begin{appendices} and \end{appendices}". Now, using these commands, the already provided solution in the above mentioned post doesn't work for my case.

Here is the sample code

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

\begin{document}

\tableofcontents

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

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

\begin{appendices}
\chapter{Parameters}
\section{BLA}
\subsection{BLA-BLA}
\end{appendices}

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

\end{document}


Kindly suggest a solution for this. Thanks a lot.

The solution consists in patching the appendices environment:

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

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

\begin{document}

\tableofcontents

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

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

\begin{appendices}%
\chapter{Parameters}
\section{BLA}
\subsection{BLA-BLA}
\end{appendices}

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

\end{document}