List of figures and list of tables in LaTeX
\listoffigures prints a list of all figures and \listoftables a list of all tables, each with caption and page number. An entry is created by every \caption; the lists are complete after the second run.
Preamble
The snippets on this page need these lines before \begin{document}:
\usepackage{graphicx}Print both lists
Put the commands where the lists should appear, usually after the table of contents.
\listoffigures
\listoftables
\section{Results}
\begin{figure}[h]
\centering
\includegraphics[width=4cm]{image.png}
\caption{Test setup}
\end{figure}
\begin{table}[h]
\centering
\caption{Measured values}
\begin{tabular}{lr}
Sensor A & 4.2 \\
Sensor B & 3.9
\end{tabular}
\end{table}A short caption for the list
The optional argument of \caption is the text for the list; the long text stays below the figure.
\listoffigures
\begin{figure}[h]
\centering
\includegraphics[width=4cm]{image.png}
\caption[Test setup]{Test setup with both sensors mounted in the
wind tunnel, seen from the side}
\end{figure}Show the lists in the table of contents
The standard classes leave both lists out of the table of contents. The tocbibind package adds them, together with the bibliography and the index; its option nottoc keeps the table of contents from listing itself. In a KOMA-Script class, use the class option listof=totoc instead.
This goes into the preamble.
\usepackage[nottoc]{tocbibind}Change the headings
The headings are stored in \listfigurename and \listtablename. With babel, change them with \setlocalecaption; without it, \renewcommand{\listfigurename}{Figures} in the preamble is enough.
This goes into the preamble.
\usepackage[ngerman]{babel}
\setlocalecaption{ngerman}{listfigure}{Abbildungen}
\setlocalecaption{ngerman}{listtable}{Tabellen}Pitfalls
- A figure or table without
\captionhas no number and does not appear in the list. - In
reportandbookeach list starts on a new page, inarticleit does not. Add\newpagewhere you want a break.
Compiled with pdfLaTeX from TeX Live 2023.
Related pages
- How-to Create a table of contents in LaTeX
- How-to Figure caption and label in LaTeX
- How-to Table caption and label in LaTeX
- Package
caption - Package
tocloft - Package
graphicx - Package
babel