title: Change Appendix formatting in LaTex
body: <p>I am using a document class template that is specific to my university's dissertation formatting requirements. It was made by a student a few years, and the university does not maintain it. Whoever made the template did not have an appendix (or the appendix formatting has changed since it was made a few years ago), because when I try to make an appendix the formatting does not comply with current formatting requirements. The standard approaches to making an appendix do not work, nor do many of the suggestions I've found on dozens of other questions / posts / blogs / etc.</p>
  
  <p>I am using Rmarkdown and compiling the PDF from a .Rnw file via Sweave.</p>
  
  <p>Below is what is produced by the existing template. I have included two versions, one where the \chapter{} is blank, and one where I use \chapter{Appendices}.</p>
  
  <p><a href="https://i.stack.imgur.com/Docyg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Docyg.jpg" alt="toc1"></a>
  <a href="https://i.stack.imgur.com/Ar5mU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ar5mU.jpg" alt="text1"></a>
  <a href="https://i.stack.imgur.com/v9YyG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v9YyG.jpg" alt="toc2"></a>
  <a href="https://i.stack.imgur.com/pLIsq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pLIsq.jpg" alt="text2"></a></p>
  
  <p>What I need is to have the TOC to look like:</p>
  
  <pre><code>Appendices                                                     128 
  
    Appendix A The CATE as a ratio of covariances .............. 128
    Appendix B CATE in Morgan and Winship (2014) ............... 130
    Appendix C Data-Generating Syntax .......................... 132
    Appendix D Estimator Syntax ................................ 136
  </code></pre>
  
  <p>And I need the text to start with just "Appendix A" centered and justified at the top of the page (and so on for each other other appendices). I cannot have "Appendices" as a header - it needs to jump straight to displaying the individual appendix names.</p>
  
  <p>I've pasted what I believe are the relevant bits from the document class template. If I have not included some important information, please let me know and I will edit my question to include that information.</p>
  
  <pre><code>% table of contents configuration
  \RequirePackage[nottoc]{tocbibind}
  \RequirePackage{tocloft}
  \renewcommand{\contentsname}{Table of Contents} % default: Contents
  \renewcommand{\cftdotsep}{0.25} % default: 4.5
  % Prefix chapter numbers with "Chapter " and add space as needed
  \renewcommand{\cftchappresnum}{\@chapapp\ }
  \newlength{\cftchappresnum@width}
  \settowidth{\cftchappresnum@width}{\cftchappresnum}
  \addtolength{\cftchapnumwidth}{\cftchappresnum@width}
  
  % chapter heading configuration
  % simplified version of the original from report.cls
  \def\@makechapterhead#1{{%
    \centering\headingsize
    % print "Chapter N"
    \@chapapp\space\thechapter
    \par\nobreak
    \vskip.25\baselineskip
    \@makeschapterhead{#1}
  }}
  % star-chapter variation
  \def\@makeschapterhead#1{{
    \centering\headingsize
    % prevent page break between following lines at all costs
    \interlinepenalty=10000
    \bfseries #1\par\nobreak
    \vskip\baselineskip
  }}
  
  % toc/lot/lof heading configuration
  \setlength{\cftbeforetoctitleskip}{\z@}
  \setlength{\cftaftertoctitleskip}{.25\baselineskip}
  \renewcommand{\cfttoctitlefont}{\headingsize\bfseries\hspace*{\fill}}
  \renewcommand{\cftaftertoctitle}{\hspace*{\fill}}
  % copy toc to lot
  \setlength{\cftbeforelottitleskip}{\cftbeforetoctitleskip}
  \setlength{\cftafterlottitleskip}{\cftaftertoctitleskip}
  \renewcommand{\cftlottitlefont}{\cfttoctitlefont}
  \renewcommand{\cftafterlottitle}{\cftaftertoctitle}
  % copy toc to lof
  \setlength{\cftbeforeloftitleskip}{\cftbeforetoctitleskip}
  \setlength{\cftafterloftitleskip}{\cftaftertoctitleskip}
  \renewcommand{\cftloftitlefont}{\cfttoctitlefont}
  \renewcommand{\cftafterloftitle}{\cftaftertoctitle}
  
  \newcommand{\maketableofcontents}{%
    \clearpage
    \tableofcontents
    \clearpage
    \listoftables
    \clearpage
    \listoffigures
    \clearpage\pagenumbering{arabic}
  }
  
  \newcommand{\makeappendix}{%
    \appendix
    % ensure that the TOC picks up the redefined value of \@chapapp
    \addtocontents{toc}{\protect\renewcommand\protect\cftchappresnum{\@chapapp\ }}
  }
  
  </code></pre>
  
  <p>A brute force solution is fine by me (if one exists). If someone is able to format the template so all future masters/doctoral students can include appendices, I'll gladly pull and branch the template and link to this question in the notes.</p>