Graphics, Figures & TablesLoF numbers starting with "Figure x"

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
anapaolabraga
Posts: 2
Joined: Fri Jul 01, 2011 8:57 pm

LoF numbers starting with "Figure x"

Post by anapaolabraga »

Hi, I need the numbers of figures, tables etc on my List of Figures, List of Tables etc to look like this:

List of Figures
Figure 1 - Caption of fig 1 .... x
Figure 2 - Caption of fig 2 .... y
Figure 3 - Caption of fig 3 .... z

====

List of Tables
Table 1 - Caption of tab 1 .... a
Table 2 - Caption of tab 2 .... b


How do I insert "Figure" and "Table" before the numbers?

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

LoF numbers starting with "Figure x"

Post by localghost »

I always wonder what else the reader would expect than figures in the LoF and tables in the LoT that makes this prefix necessary. However, I See three possible solutions depending on the used document class.
  1. The tocloft package (for use with the standard classes).

    Code: Select all

    \documentclass[11pt,a4paper]{report}
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage{tocloft}
    
    \addtolength{\cftfignumwidth}{3em}
    \renewcommand{\cftfigpresnum}{\figurename\ }
    \addtolength{\cfttabnumwidth}{3em}
    \renewcommand{\cfttabpresnum}{\tablename\ }
    
    \begin{document}
      \listoffigures
      \listoftables
    	
      \chapter{Foo}
        \begin{figure}[!ht]
          \centering
          \rule{6.4cm}{3.6cm}
          \caption{Dummy figure}\label{fig:dummy}
        \end{figure}
    
        \begin{table}[!ht]
          \centering
          \rule{6.4cm}{3.6cm}
          \caption{Dummy table}\label{tab:dummy}
        \end{table}
    \end{document}
  2. The classes of KOMA Script have a built-in feature.

    Code: Select all

    \documentclass[%
      listof=entryprefix,
      captions=tableabove
    ]{scrreprt}
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    
    \begin{document}
      \listoffigures
      \listoftables
    	
      \chapter{Foo}
        \begin{figure}[!ht]
          \centering
          \rule{6.4cm}{3.6cm}
          \caption{Dummy figure}\label{fig:dummy}
        \end{figure}
    
        \begin{table}[!ht]
          \centering
          \caption{Dummy table}\label{tab:dummy}
          \rule{6.4cm}{3.6cm}
        \end{table}
    \end{document}
  3. The memoir class has built-in features very similar to those of the tocloft package.

    Code: Select all

    \documentclass[11pt,a4paper]{memoir}
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    
    \addtolength{\cftfigurenumwidth}{3em}
    \renewcommand{\cftfigurepresnum}{\figurename\ }
    \addtolength{\cfttablenumwidth}{3em}
    \renewcommand{\cfttablepresnum}{\tablename\ }
    
    \begin{document}
      \listoffigures
      \listoftables
    	
      \chapter{Foo}
        \begin{figure}[!ht]
          \centering
          \rule{6.4cm}{3.6cm}
          \caption{Dummy figure}\label{fig:dummy}
        \end{figure}
    
        \begin{table}[!ht]
          \centering
          \rule{6.4cm}{3.6cm}
          \caption{Dummy table}\label{tab:dummy}
        \end{table}
    \end{document}

Thorsten
Post Reply