Graphics, Figures & TablesHide LoF or LoT when empty

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
bhpayne
Posts: 2
Joined: Mon Mar 19, 2012 9:53 pm

Hide LoF or LoT when empty

Post by bhpayne »

Hello. I have a ToC and then a LoF and LoT in my documents. I am compiling this with and without tables and figures.

Is there a way to detect if the number of tables in the document is zero? If yes, then I want to hide (comment out) the \listoftables command. If the number of tables is non-zero, then the command should be included. Same for \listoffigures.

I searched google and this forum without any useful returns.


Thanks in advance,
Ben

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

bhpayne
Posts: 2
Joined: Mon Mar 19, 2012 9:53 pm

Re: Hide LoF or LoT when empty

Post by bhpayne »

After more searching I found a solution:

http://tex.stackexchange.com/questions/33193
Post Reply