Creating lists of figures and tables in LaTeX
Abstract
Using Lists of Tables and Figures in the front matter of a document that uses the IEEE bibliographic reference style may cause wrong numbering of citations, when sources are cited in the figures or tables captions. This post presents a solution to have documents cited in figure and table captions without disrupting the correct numbering of references.
Introduction
Long structured documents, such as MSc and PhD dissertations and thesis, often include elements like the list of figures or list of tables in the front matter 1. These lists identify the titles (or captions) of the respective items and their corresponding location in the text.
In the Electronic and Computer Engineering domain, these documents usually use the IEEE bibliographic reference style. In this style, citations consist of a sequential number, identifying the cited work, written inside square brackets (e.g., [1]). The numbering of the references follows the order they appear in the text: the first reference to appear in the text gets the number [1], the following [2], and so on. Managing references in the text is supported by most text editors and compilers, such as LaTeX and BibTeX.
The two things mix together when tables and figures have references in the caption. When these captions are used in the lists of tables and figures and the document is processed, these references are the first to appear in the text and they get the first numbers in the sequence. This will cause errors in reference numbering, as the references that appear first in the main text will not get the lowest reference numbers. The numbers [1], [2], … have been assigned to the references that are cited in the captions listed in the List of Figures and the List of Tables.
An example
The file teste.tex contains a very short report, with a table with a caption that includes a reference and a few references in the text. The resulting pdf shows that the ordering of reference numbering has been reversed, because the table caption contains a citation.
The source code for the table is the following:
\begin{table}
\centering
\begin{tabular}{|l|c|} \hline
\bf Time & \bf Success rate \\ \hline
Before & 73\% \\ \hline
After & 81\% \\ \hline
\end{tabular}
\caption{A table from \cite{pedro_fonseca_bringing_2020}}
\label{tab:successrates}
\end{table}
The document contains a List of Tables, that appears in the front matter, including the citation, that gets numbered:
The citation in the caption will cause the reference to appear in the List of Tables and causing the numbering of references to be incorrect:
Because the second reference mentioned in the text is included in the table caption, and this caption appears in the List of Tables, it is numbered as [1], which is not the intended result.
Solution
The reversal of reference numbering is avoided by including the option argument in the \caption
command. The correct way to create the caption for the table would be:
\begin{table}
\centering
\begin{tabular}{|l|c|} \hline
\bf Time & \bf Success rate \\ \hline
Before & 73\% \\ \hline
After & 81\% \\ \hline
\end{tabular}
\caption[Students success rate]{Students success rate (from~\cite{pedro_fonseca_bringing_2020})}
\label{tab:successrates}
\end{table}
Notice the optional argument of the caption command (between square brackets []
); this will be used to create the List of Tables and it does not contain any reference.
The mandatory argument (between curly brackets {}
) will be used to create the caption, including the reference.
In this way, the correct ordering of references in the text is assured:
-
See, for instance, section 3.3 of “The Mayfield Handbook of Technical and Scientific Writing” ↩
Comments
Your comments are welcome. Feel free to leave here your remarks or your opinion!