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. |
toc | Option: adds a line "Appendices" to the table of contents before the first appendix. |
page | Option: prints the heading "Appendices" at the start of the environment. |
title | Option: headings read "Appendix A Data" instead of "A Data". |
titletoc | Option: 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}Compiled with pdfLaTeX from TeX Live 2023. Tools run in this order: pdflatex → pdflatex.
Pitfalls
babeltranslates\appendixname, the word in each heading, but not the heading "Appendices" and its line in the table of contents. For another language, redefine\appendixpagenameand\appendixtocnameyourself.- With
reportorbook, the optionpageputs the heading "Appendices" on a page of its own, like a\partheading.
Related pages
- How-to Add an appendix in LaTeX
- How-to Create a table of contents in LaTeX
- How-to Set up a thesis in LaTeX