GeneralNeed help with \listoftables and \listoffigures.

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Vertol Captain
Posts: 1
Joined: Tue Apr 15, 2008 5:28 am

Need help with \listoftables and \listoffigures.

Post by Vertol Captain »

I have written my PhD dissertation, so now I am formatting it. The command \tableofcontents worked very well. Unfortunately, the commands \listoftables and \listoffigures did not list any of my tables or figures. How should I label my tables and figures?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Need help with \listoftables and \listoffigures.

Post by gmedina »

If you use the standard table and figure environmnets for floating objects then all you need to do is to use the \caption command. In this case, to customise your captions it is advisable to load the caption package.

Take a look at the following example:

Code: Select all

\documentclass{article}
\usepackage[font=small,labelfont=bf]{caption}[2008/04/01]

\begin{document}

\listoffigures
\cleardoublepage
\listoftables
\cleardoublepage

\begin{figure}[!ht]
  \centering
  \fbox{Test figure 1}
  \caption{test figure 1}
  \label{fig:testfigone}
\end{figure}

\begin{table}[!ht]
  \centering
  \begin{tabular}{c}
    test table 1
  \end{tabular}
  \caption{test table 1}
  \label{tab:testtabone}
\end{table}

\newpage

\begin{table}[!ht]
  \centering
  \begin{tabular}{c}
    test table 2
  \end{tabular}
  \caption{test table 2}
  \label{tab:testtabtwo}
\end{table}

\begin{figure}[!ht]
  \centering
  \fbox{Test figure 2}
  \caption{test figure 2}
  \label{fig:testfigtwo}
\end{figure}

\end{document}
Another option is to manually create the lists of tables and figures. It depends on how are you building them.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
uetech
Posts: 4
Joined: Tue Apr 15, 2008 1:30 pm

Re: Need help with \listoftables and \listoffigures.

Post by uetech »

Just want to point out one thing specifically which I found out yesterday, the hard way. In order for figure referencing to be correct, the figure label should come immediately after the figure caption as rightly used by gmedina, or even inside it, but not before.
Post Reply