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}
Result
The compiled example

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}
Result
The compiled example

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}

Open in the editor

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}

Open in the editor

Pitfalls

Compiled with pdfLaTeX from TeX Live 2023.

Related pages