Adding appendices in LaTeX
Help centre › LaTeX › Document layout · Packages: appendix
Write \appendix once, then start each appendix with \section{…} (or \chapter{…} in a report or book): from that point sections are lettered A, B, C. For headings and contents entries that read "Appendix A", use \begin{appendices} … \end{appendices} from the appendix package.
A complete example
A whole document: paste it into an empty project and compile it.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\section{Introduction}
The proof of the main result is in Appendix~\ref{app:proof}.
\section{Results}
The bound in Equation~\eqref{eq:bound} holds for every $n$.
\appendix
\counterwithin{equation}{section}
\section{Proof of the main result}\label{app:proof}
\begin{equation}
\sum_{k=1}^{n} k = \frac{n(n+1)}{2} \label{eq:bound}
\end{equation}
\section{Additional data}
Further tables.
\end{document}What \appendix does
\appendix is a switch, not an environment: it resets the section counter and numbers sections with capital letters. In a report or book it does the same for chapters, and headings read "Appendix A". Everything after it is appendix material, so put it after the main text and, if the journal wants appendices after the references, after the bibliography.
To number equations, figures and tables A.1, A.2, add \counterwithin{equation}{section} (and the same for figure and table) after \appendix, as in the example.
The appendix package
The appendices environment adds what \appendix alone does not: the title option prefixes each heading with "Appendix", toc adds an "Appendices" entry to the contents, titletoc prefixes contents entries with "Appendix", and page puts an "Appendices" page before them.
\documentclass{article}
\usepackage[toc,title]{appendix}
\begin{document}
\tableofcontents
\section{Main text}
See Appendix~\ref{app:data}.
\begin{appendices}
\section{Data tables}\label{app:data}
The full data.
\section{Questionnaire}
The questions asked.
\end{appendices}
\end{document}A single appendix
With one appendix, many journals want the heading "Appendix" without a letter. In the article class, \appendix followed by \section*{Appendix} gives that, but an unnumbered section has no number to reference and its equations keep the main numbering.
Supplementary material in a separate file
Journals often want supplementary material as its own PDF. Compile it as a separate document; the xr package (\externaldocument{main}) lets it refer to labels in the main paper, and the paper to labels in it.
Common mistakes
- Forgetting
\appendixnumbers the appendix sections 5, 6, 7 as if they were part of the main text. - Writing
\begin{appendix}instead of\appendixhappens to work in some classes and fails in others; use the command. \appendixinside anappendicesenvironment, or both together, letters the sections twice or restarts them; use one.
In journal templates
- elsarticle: after
\appendix, each\sectionis headed "Appendix A" and its equations are numbered (A.1) automatically. - IEEEtran:
\appendixfor one appendix (headed "Appendix"),\appendicesfor several ("Appendix A", "Appendix B"). - revtex:
\appendixletters the following sections as appendices. - Journals differ on whether appendices go before or after the references; their author guidelines say which.
Errors you may meet
- LaTeX Warning: Reference `<label>' on page <n> undefinedA \ref, \eqref or \pageref names a label LaTeX has not seen: a typo, a missing \label, or a part excluded by \includeonly. Prints ?? in the PDF.
- LaTeX Error: Environment <name> undefined\begin{…} names an environment no loaded package defines: load the package (amsmath for align), fix the spelling, or define it with \newtheorem.
Related
- Referencing equations, figures and tables in LaTeXPut \label after \caption or inside the equation, refer with \ref, \eqref or cleveref's \cref, and compile twice so the numbers appear.
- Adding authors, affiliations and ORCID iDs in LaTeXNumbered affiliations with authblk, ORCID iD links with orcidlink, and the author macros of elsarticle, IEEEtran, revtex and acmart.
The examples on this page were compiled with pdfLaTeX to check that they work as shown. LaTeX quick reference · LaTeX errors explained