The appendix package

Provides the appendices environment and options that add the word "Appendix" to headings and an "Appendices" entry to the table of contents.

Loading the package

\usepackage[toc,page]{appendix}

The \appendix command of the standard classes switches the numbering to letters for the rest of the document. The appendices environment does the same but ends again: after \end{appendices} the numbering of the normal sections or chapters continues.

Package options add what \appendix leaves out: a heading "Appendices" before the first appendix (page), a matching line in the table of contents (toc), and the word "Appendix" before the letter in each heading (title) and in each contents entry (titletoc).

Main commands

\begin{appendices} ... \end{appendices}Sections or chapters inside are numbered A, B, C.
tocOption: adds a line "Appendices" to the table of contents before the first appendix.
pageOption: prints the heading "Appendices" at the start of the environment.
titleOption: headings read "Appendix A Data" instead of "A Data".
titletocOption: the same prefix in the entries of the table of contents.
\renewcommand{\appendixpagename}{Anhang}Text of the heading; \appendixtocname is the text in the table of contents and \appendixname the word in each heading.
\begin{subappendices} ... \end{subappendices}Appendices at the end of a single chapter or section, numbered one level lower.

Complete example

\documentclass{article}
\usepackage[toc,page,title]{appendix}
\begin{document}
\tableofcontents
\section{Results}
The raw data are in Appendix~\ref{app:data}.

\begin{appendices}
\section{Raw data}\label{app:data}
This section gets the letter A.
\section{Proofs}
This section gets the letter B.
\end{appendices}
\end{document}
Result
The compiled example

Open in the editor

Compiled with pdfLaTeX from TeX Live 2023. Tools run in this order: pdflatex → pdflatex.

Pitfalls

Related pages