% Eytan Zweig's "NYU thesis guidelines template for dissertations with appendices"

% NYU's dissertation guidelines state that if there is more than one appendix, the appendices cannot be listed
% in the table of contents, but rather a single "appendices" entry needs to appear there and a separate
% "List of appendices" should list the individual appendices. This is pretty tricky to do in LaTeX, but I figured
% out a solution. 

\documentclass[12pt, oneside, openany]{book}
% These margins are the minimum NYU will accept (at least in my experience)
\usepackage[left=1.6in,top=1.1in,right=1.1in,bottom=1.5in]{geometry}

% These packages are necessary for my solution to work. 

% Fncychap is used for fancy chapter headings, but it also gives the formatting commands I needed to define the new 
% \appendixchapter command. You should look at its documentation and pick a nice style to use.
\usepackage{fncychap}

% Appendix allows the inclusion of a line for "appendices", which otherwise won't get the right page number. You must
% use the [toc] option.
\usepackage[toc]{appendix}

% Tocloft is used to create the new list of appendices. You must use the [titles] option.
\usepackage[titles]{tocloft}

% Number the subsubsections and include them in the TOC
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

% Create list of appendices, and don't include appendices in the table of contents
\newlistof{appendixchapter}{apx}{List of Appendices}

\newcommand{\appendixchapter}[1]{%
    \refstepcounter{appendixchapter}%
    \refstepcounter{chapter}%
    \renewcommand{\DOTIS}[1]{\DOCH \DOTI{#1}}
    \chapter*{#1}
    \addcontentsline{apx}{appendixchapter}{Appendix \protect\numberline{\theappendixchapter}#1}\par%
    \vspace {-1.47cm}}
    
\renewcommand{\theappendixchapter}{\Alph{appendixchapter}}

\newcommand{\appendixsection}[1]{%
    \refstepcounter{section}%
    \section*{\protect{\thesection}\hspace{2.6ex}#1}}
    
\newcommand{\appendixsubsection}[1]{%
    \refstepcounter{subsection}%
    \subsection*{\protect{\thesubsection}\hspace{2.5ex}#1}}

\begin{document}

    \frontmatter

    \pagestyle{plain}

    \tableofcontents

    \listofappendixchapter
    \addcontentsline{toc}{chapter}{List of Appendices}

    \mainmatter

    \pagestyle{plain}

    \chapter{Example chapter}
    
    You use the normal commands for regular chapters.
    
    \section{Example section}
    \subsection{Example subsection}
    \subsubsection{Example subsubsection}
    
    \begin{appendices}

    % Use the appendixchapter command to introduce each appendix
    \appendixchapter{An appendix without sections}

    \appendixchapter{An appendix with sections}
    % Use the appendixsection and related commands for sections and subsections in appendices. 
    % Don't use the regular section commands or weird stuff will happen.
    % You probably don't need an appendixsubsubsection command, but if you do, you'll need to figure out the spacing for its title yourself.
    \appendixsection{An example section in an appendix}
    \appendixsubsection{An example subsection in an appendix}
    
    \end{appendices}

    \backmatter

\end{document}

