How-to

How to Add an Appendix in LaTeX

The fix

To add an appendix in LaTeX, write \appendix once, then start each appendix with \section{...} (article) or \chapter{...} (report, book). Everything after \appendix is lettered A, B, C instead of numbered. For headings that read "Appendix A" and an "Appendices" entry in the table of contents, use the appendix package and its appendices environment.

Not sure it worked on your document? Paste it into LetX and compile it, free and in the browser.

Why it happens

\appendix is a switch, not an environment or a heading. It resets the section (or chapter) counter and changes its format to capital letters; it prints nothing itself. In report and book it also changes the chapter heading from "Chapter" to "Appendix". The article class has no such word, which is why a section after \appendix reads "A Raw data", not "Appendix A Raw data".

Example

\section{Conclusion}
Main content ends here.

\appendix
\section{Raw data}      % numbered A
\section{Survey form}   % numbered B

Getting "Appendix A" in the heading

In report and book, a \chapter after \appendix already prints "Appendix A" above its title. In article, load the appendix package with the title option and put the appendix sections inside the appendices environment; the headings then read "Appendix A Raw data". The environment does the work of \appendix, so do not write both.

The other options: toc adds an "Appendices" line to the table of contents, page adds an "Appendices" title before the first appendix, titletoc puts "Appendix" before each appendix in the contents, and header adds it to the page headers.

\usepackage[toc,page,title,titletoc]{appendix}
% in the document:
\tableofcontents
\section{Results}
Main text.

\begin{appendices}
\section{Raw data}\label{app:data}
\section{Survey form}
\end{appendices}

Figures, tables and equations in an appendix

In article, figure and table numbers carry on from the main text, so the first appendix figure might be Figure 7, where most style guides want Figure A.1. Add \counterwithin{figure}{section} right after \appendix, and the same for table and equation. From there on the counters restart in each appendix and print as A.1, A.2, B.1. In report and book they are numbered by chapter already, so appendix figures come out as A.1 without any change.

\usepackage{graphicx}
% in the document:
\appendix
\counterwithin{figure}{section}
\counterwithin{table}{section}
\section{Extra results}
\begin{figure}[h]
  \centering
  \includegraphics[width=0.5\linewidth]{example-image}
  \caption{Robustness check}   % Figure A.1
\end{figure}

Referencing an appendix

Label the heading and refer to it as Appendix~\ref{app:data}, which prints "Appendix A". The tilde keeps the word and the letter on one line.

cleveref is meant to detect \appendix and print "appendix A", but in TeX Live 2025 \cref on an appendix section prints "section A" (and "chapter A" in report). Add \crefalias{section}{appendix} after \appendix (with chapter in place of section in report and book), and \cref prints "appendix A" and \Cref "Appendix A".

\usepackage{cleveref}   % load it after other packages
% in the document:
\section{Results}
The raw numbers are in \cref{app:data}.   % appendix A

\appendix
\crefalias{section}{appendix}
\section{Raw data}\label{app:data}

Placement and common mistakes

Where the appendix goes depends on your style guide: some want it after the references, others before. For after, write \appendix and the appendix sections after \bibliography or \printbibliography.

\appendix takes no argument. \appendix{Data} prints the word "Data" as stray text; the title belongs in the \section or \chapter that follows.

Appendix sections still numbered 4, 5, 6 mean the \appendix line is missing or comes after them. "Environment appendices undefined" means the appendix package is not loaded.

An unnumbered \section*{Appendix} works for a single appendix with no letter, but it is left out of the table of contents unless you add \addcontentsline{toc}{section}{Appendix} after it.

Frequently asked questions

How do I get Appendix A, B, C instead of numbers?

Put \appendix once before your appendix sections. Every \section after it is lettered automatically. In the report and book classes, use \chapter for "Appendix A" chapters.

How do I get "Appendix A" in an article heading?

Load \usepackage[title]{appendix} and put the sections inside \begin{appendices} ... \end{appendices}. The article class on its own prints only the letter.

How do I add the appendix to the table of contents?

Lettered appendix sections appear in the contents like any other section. For an "Appendices" line above them, use the appendices environment from the appendix package with the toc option.

How do I number figures in the appendix as A.1?

In article, write \counterwithin{figure}{section} right after \appendix. report and book do this already, because they number figures by chapter.

Should the appendix go before or after the references?

Both are common, so follow your journal or university. For appendices after the references, put \appendix and the appendix sections after \bibliography or \printbibliography.

How do I reference an appendix?

Write Appendix~\ref{app:data}. With cleveref, add \crefalias{section}{appendix} after \appendix so that \cref prints "appendix A".

Related LaTeX fixes

Browse all LaTeX problems & fixes, or start with the LaTeX guide.

Learn the topic properly

Try the fix in LetX

Open the editor, paste your code, and compile in seconds to see the error clear. Free, in your browser.

Open LetX Free