GeneralHow to insert word 'Table' or 'Figure' before Table no. in L

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
vinD
Posts: 2
Joined: Wed Dec 19, 2007 7:46 pm

How to insert word 'Table' or 'Figure' before Table no. in L

Post by vinD »

Hi

When Latex generates List of Figures (LOF) or List of Tables (LOT), it just shows the number..like 2.1, 4.5 etc...I was wondering if there is a way to insert word 'Table' or 'Figure' before it ? ..like Table 2.1, Figure 4.5 etc

Any ideas ?

Thanks

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: How to insert word 'Table' or 'Figure' before Table no. in L

Post by localghost »

Does that make any sense? What else as figures would be listed in the LoF and will there be other objects than tables in the LoT?


Best regards and welcome on Board
Thorsten
Last edited by localghost on Wed Dec 19, 2007 10:09 pm, edited 1 time in total.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

How to insert word 'Table' or 'Figure' before Table no. in L

Post by gmedina »

The tocloft package can be useful; take a look at the following example for the case of the list of tables:

Code: Select all

\documentclass{article} 
\usepackage{tocloft}

\renewcommand{\cfttabpresnum}{TABLE }
\newlength{\mylen}
\settowidth{\mylen}{\cfttabpresnum\cfttabaftersnum}
\addtolength{\cfttabnumwidth}{\mylen}

\begin{document} 
\listoftables

\begin{table}[!ht]
  \centering
  \fbox{Test table}
  \caption{The first table}
\end{table}

\begin{table}[!ht]
  \centering
  \fbox{Test table}
  \caption{The second table}
\end{table}

\begin{table}[!ht]
  \centering
  \fbox{Test table}
  \caption{The third table}
\end{table}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
vinD
Posts: 2
Joined: Wed Dec 19, 2007 7:46 pm

Re: How to insert word 'Table' or 'Figure' before Table no. in L

Post by vinD »

Hi

Thank you for reply. I do understand that it makes no sense but this is the comment that I have received on my thesis from thesis editor. It has been mentioned that they will accept the thesis without incorporating this comment if it is generated by latex file. But I was just wondering if it is at all possible.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: How to insert word 'Table' or 'Figure' before Table no. in L

Post by localghost »

Hm, I see. Editors and their guidelines. Some of them seem not to have any ideas of things that do make sense and of those that do not.
Post Reply