General ⇒ Adding table to List of Tables
Adding table to List of Tables
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
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
Re: Adding table to List of Tables
\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.
Adding table to List of Tables
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: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.
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}