Graphics, Figures & Tableslist of figures

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ziselos
Posts: 15
Joined: Sun Mar 04, 2018 12:03 pm

list of figures

Post by ziselos »

I would like to ask if there is a way to export the list of figures to a separate file (CSV, pdf or any other)? Just as it is produced in the pdf file :

Figure label page number
figure 1 10
figure 2 20

My purpose is to be able to have a file with figures and page number of them, every time I make changes to my main tex file.

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

list of figures

Post by Johannes_B »

There already is such a file, which is updated each time. It has the file ending lof.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
ziselos
Posts: 15
Joined: Sun Mar 04, 2018 12:03 pm

list of figures

Post by ziselos »

Yes I can see it each time I export PDF again. So is there a way to edit it? Open it and see its format?
ziselos
Posts: 15
Joined: Sun Mar 04, 2018 12:03 pm

list of figures

Post by ziselos »

Ok i opened the lof file and saw its content. It is something like this:

Code: Select all

\select@language {english}
\addvspace {10\p@ }
\addvspace {10\p@ }
\contentsline {figure}{\numberline {2.1}{\ignorespaces A test}}{7}{figure.2.1}
\addvspace {10\p@ }
\contentsline {figure}{\numberline {3.1}{\ignorespaces A test2}}{11}{figure.3.1}
So i have to write a script that extracts the name of each figure (A test, A test2) and the page number (7, 11) on another file?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

list of figures

Post by Stefan Kottwitz »

That content is LaTeX, so you can run LaTeX on it.

Code: Select all

\documentclass{article}
\usepackage[english]{babel}
\let\addvspace\vspace
\begin{document}
\makeatletter
\input{yourfilename.lof}
\end{document}
Stefan
LaTeX.org admin
ziselos
Posts: 15
Joined: Sun Mar 04, 2018 12:03 pm

list of figures

Post by ziselos »

Thank you Stefan, i agree with you. I run the file as you said and the export is what i want.
Thanks again for your help.
rolf_claus
Posts: 1
Joined: Fri Oct 19, 2018 5:00 pm

list of figures

Post by rolf_claus »

Thanks stranger for your help! Here it is:

\let\addvspace\vspace

This error message cost me more than 3 years searching for a solution of the problem. One could click it away but this still was frustrating.

I don't understand what this line really stands for but it does the trick. I eventually got rid of the enervating

\addvspace {10\p@}

which didn't give any hint of it's origin.
Post Reply