GeneralAdding table to List of Tables

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
user
Posts: 7
Joined: Sun Oct 26, 2008 12:29 am

Adding table to List of Tables

Post by user »

Hi.

Ive got a little problem with the List of Tables. It is supposed to add tables automatically after I inserted a command \listoftables. Im working with swp. Its working with LOF though. So how can I get this to work for LOT? Is there some simple command that I can enter for each table to be added? I could just write under the heading list of tables, but the format is not quite uniform with the other lists. Please help. thanks.

DA

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

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Re: Adding table to List of Tables

Post by phi »

Hello,

\listoftables works exactly like \listoffigures. So if you have table environments with captions in your document and compile twice, they will show up in the list. NB: What appears in the list is the captions of table environments; tabular or tabbing environments outside a table environment won't show up.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Adding table to List of Tables

Post by gmedina »

Hi,
phi wrote:Hello,

\listoftables works exactly like \listoffigures. So if you have table environments with captions in your document and compile twice, they will show up in the list. NB: What appears in the list is the captions of table environments; tabular or tabbing environments outside a table environment won't show up.
The part that I put in boldface is not quite true. The caption package implements the \captionof command that allows tables to be given a caption (and therefore be listed in the list of tables) without using a table environment. A similar remark applies also to figures outside a figure environment. The following example illustrates this fact for tables:

Code: Select all

\documentclass{report}
\usepackage{caption}

\begin{document}
\listoftables
\newpage

\begin{table}[!ht]
  \centering
  \begin{tabular}{cc}
    column1 & column2
  \end{tabular}
  \caption{a floating test table.}
  \label{tab:testtab1}
\end{table}

\noindent\begin{minipage}{\textwidth}
  \centering
  \begin{tabular}{cc}
    column1 & column2
  \end{tabular}
  \captionof{table}{a non-floating test table.}
  \label{tab:testtab2}
\end{minipage}

\end{document}
Please refer to the package documentation for further information.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply