List of Tables and Figures
In this section you will learn how to create and customize lists of figures and tables in LaTeX. These lists improve the organization and accessibility of specific elements within your document.
Introduction
Creating a list of figures and tables in LaTeX is essential for organizing information and facilitating easy navigation within a document. These lists provide readers with quick access to specific elements, enhancing the document's readability and usability. By following the instructions in this section, you can effectively generate and customize lists of figures and tables in your LaTeX document.
Below is an example illustrating the lists of figures and tables for a document that includes three tables and three figures:
The \listoftables
command
The \listoftables
command generates a list of tables in your document. It automatically compiles a list that includes the captions and corresponding page numbers of all the tables you have defined in your document. This command is typically placed in the document where you want the list of tables to appear, such as at the beginning or in a dedicated section.
Here's an example of using the \listoftables
command at the beginning of your document:
\documentclass{article}
\begin{document}
\listoftables
% Your document content and tables go here
\end{document}
When you compile the document, the \listoftables
command will generate the list of tables based on the tables you have defined using the table environment with captions and labels.
The \listoffigures
command
Similarly, to enable the list of figures, you need to include the \listoffigures
command. It automatically compiles a list that includes the captions and corresponding page numbers of all the figures you have defined in your document. This command is typically placed in the document where you want the list of figures to appear, such as at the beginning or in a dedicated section.
Here's an example of using the \listoffigures
command at the beginning of your document:
\documentclass{article}
\begin{document}
\listoffigures
% Your document content and figures go here
\end{document}
When you compile the document, the \listoffigures
command will generate the list of figures based on the figures you have defined using the figure environment with captions and labels.
Prerequisites for using \listoftables
and \listoffigures
Before using the \listoftables
and \listoffigures
commands in your LaTeX document, there are some prerequisites you need to consider:
1. Include the necessary packages
To generate the lists of tables and figures, you need to include the caption
package in your document. This package provides additional functionality for captions and formatting of tables and figures. You can include it by adding the following command to the preamble of your document:
\usepackage{caption}
2. Use the correct document class
The document class you are using should support the generation of lists of tables and figures. Most standard document classes like article, report, and book provide this support by default. However, if you are using a custom document class, make sure it includes the necessary functionality for generating the lists.
3. Use the \caption
command
Provide a caption for each table and figure using the \caption
command within the corresponding table or figure environment.
4. Assign labels using the \label
command
Assign a unique label to each table and figure using the \label
command after the \caption
command.
Here is an example of adding caption and lable for figure and table:
\begin{table}[ht]
\centering
\caption{Example table caption.}
\label{table:table-example}
% table content goes here
\end{table}
\begin{figure}[ht]
\centering
\caption{Example figure caption.}
\label{fig:figure-example}
% figure goes here
\end{figure}
5. Compile the document twice
After adding or modifying tables and figures, compile the LaTeX document twice to update the list of tables and figures.
Changing the title of the lists
To change the default titles of the lists of tables and figures in LaTeX, you can use the \renewcommand
command. Here's how you can customize the titles:
- Changing the title of the list of tables:
\renewcommand{\listtablename}{New Title for List of Tables}
- Changing the title of the list of figures:
\renewcommand{\listfigurename}{New Title for List of Figures}
Replace "New Title for List of Tables" and "New Title for List of Figures" with your desired titles.
Place these \renewcommand
commands in the preamble of your LaTeX document, before the \begin{document}
command. This ensures that the changes are applied throughout the document.
After making these changes, when you generate the list of tables or list of figures using the \listoftables
or \listoffigures
commands, the new titles you specified will be displayed. For example:
\documentclass{article}
\usepackage{graphicx}
% Change the titles of the lists
\renewcommand{\listtablename}{Tables}
\renewcommand{\listfigurename}{Figures}
\begin{document}
% Generate the table of contents
\tableofcontents
% Generate the list of tables
\listoftables
% Generate the list of figures
\listoffigures
% Your document content, tables and figures go here
\end{document}
As shown in the following output, the new titles will be displayed:
Best practices and tips
In order to remove the page numbers and headers/footers from the pages where the lists are displayed, the following commands can be used:
\thispagestyle{empty}
→ Used to remove the page numbering and header/footer content from a specific page.\listoftables
→ Starting the page numbering from the current page using Arabic numerals (1, 2, 3, ...).
Here's an example demonstrating the usage of these commands which often used when transitioning from front matter (e.g., title page, table of contents) to the main body of the document.
\documentclass{article}
\begin{document}
% Remove page numbers and headers/footers from the list of tables and figures page
\thispagestyle{empty}
\listoftables
\listoffigures
% Resume page numbering and switch to Arabic numerals
\pagenumbering{arabic}
% Rest of the document
\end{document}
This ensures that the lists of tables and figures do not have any numbering or additional elements that might distract from the content of the lists themselves.