# List of appendices without chapter titles

This was somewhat similar to what I am looking for, but not exactly: How to make appendices behave like sections in ToC

I would like for my appendices to do the following:

1. One chapter in the ToC for all appendices
2. Appendices behave like sections and are labeled A, B, C, etc.
3. \ref command inserts the appendix label, not a number
4. Appendices have their name and label in the page header, no need for chapter, section or other headings.

The resulting ToC would look like this:

Some Chapter 1
Some section 1
Some Chapter 2
Some section 2
Appendices
Appendix A - Some name
Appendix B - Some name 2
etc.


Currently I can only reproduce this behaviour by adding the content lines manually, using phantom sections to get the page numbers correct and manual naming for the ToC lines and headers. This leads to a problem that my labels and references use numbers instead of the letters defined for the counter. With the command below I would have to define the header for each appendix manually.

\refstepcounter{AppCounter}
\includegraphics ...
\label{app:appA}


The other problem with using appendix package is that I could not figure out how to have appendix labels without chapters/sections. And chapter/section commands add the text to the page, which is something I have no use for.

• First to get the "Appendices" entry in the toc you should add \addcontentsline{toc}{chapter}{Appendices} in your .tex file just before the first appendix. – Ludovic C. Jul 18 '13 at 13:17
• How should the appendices heading (not headers) look like in your document? Do they appear using the formatting for chapters? – Gonzalo Medina Jul 18 '13 at 13:24
• @LudovicC. I used that command when adding everything manually. Now I am looking for something that would do the additions to ToC somewhat automatically. – saikon Jul 18 '13 at 13:30
• @GonzaloMedina The same formatting used for chapters is not exactly what I am looking for. The format now has only the chapter name in the top left corner and the page number on top right. I would like it to have the appendix name in there also. And I have manually added the page number to the bottom of the page. (\fancyhead[R]{Appendix \Alph{AppCounter} - Some name} and \fancyfoot[C]{\thepage}) – saikon Jul 18 '13 at 13:33
• As I said, I am not asking about headers. I am asking about the headings (possible label + number + title. as in "Chapter A The title of the Appendix"). Do you use \chapter to produce the headings? – Gonzalo Medina Jul 18 '13 at 13:40

Here is an idea:

\newcommand{\startappendix}{%
\pagebreak%
\setcounter{section}{0}%
\renewcommand{\thesection}{\Alph{section}}%
}

\newenvironment{newappendix}[2]%
\phantomsection%
\refstepcounter{section}%
\label{app:#2}}
\newpage}


Add these two commands in your preamble. The first one should be used when you want to start your appendices. The second one is to use each time you want to change the name of the current appendix. The first argument is the name of the appendix and the second is what will be added the the app: prefix for the label. You can then call the appendix with the \ref{app:<your second argument>} wherever you want in your code.

Example

Here is a short example of the code and its output

\documentclass{report}
\usepackage[demo]{graphicx}
\usepackage{hyperref}
\usepackage{fancyhdr}
\pagestyle{fancy}

\newcommand{\startappendix}{%
\pagebreak%
\setcounter{section}{0}%
\renewcommand{\thesection}{\Alph{section}}%
}

\newenvironment{newappendix}[2]%
\phantomsection%
\refstepcounter{section}%
\label{app:#2}}
\newpage}

\begin{document}
\tableofcontents

\chapter{One}
\section{One-one}

\startappendix

\begin{newappendix}{First}{1}
\includegraphics[width=12cm,height=15cm]{test}
\end{newappendix}

\begin{newappendix}{Second}{2}
\includegraphics[width=12cm,height=15cm]{test}
\end{newappendix}

\end{document}


EDIT Another way to go I found thanks to egreg for the second command:

\fancyhead[R]{Appendix \rightmark}

\newcommand{\newappendix}[2]{%
\clearpage%
\phantomsection%
\refstepcounter{section}%
\markright{\thesection \ -- #1}%
\label{app:#2}
}

• Thank you @Ludovic. Tweaked your code a little bit, but this really worked like a charm. Had to fiddle a bit with it to get the hyperref links working correctly. Added my result to this question also. – saikon Jul 19 '13 at 7:19

Modified the solution a little bit sent by @Ludovic.

• Added a title page for appendices using \appendixpage
• Removed the label from the enviroment since Sublime Text & LaTeXTools cannot parse it from there
• Reordered the elements a little bit to get hyperref links working
• Used the name commands from appendix package to easily change the values used (for different languages)
• The margin settings I added were just specific for my needs

Here is the solution I ended up using:

    \newcommand{\startappendix}{%
\renewcommand{\appendixtocname}{Appendices}%
\renewcommand{\appendixname}{Appendix}%
\renewcommand{\appendixpagename}{Appendices}%
\cleardoublepage%
\appendixpage%
\fancyfoot{}%
\newgeometry{margin=2cm}%
\fancyfoot[C]{\thepage}%
\pagestyle{fancy}%
\setcounter{section}{0}%
\renewcommand{\thesection}{\Alph{section}}%
}

\newenvironment{newappendix}[1]%