Graphics, Figures & TablesGenerate PDF without floats

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ultimatesadness
Posts: 3
Joined: Thu Sep 03, 2009 3:13 pm

Generate PDF without floats

Post by ultimatesadness »

Hello,

I want to generate a PDF without figures and tables. Is there an easy way to "turn them off" ... This is for preview purpose only, so minimal changes in the tex-file are preferred.

Thanks,
US

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Generate PDF without floats

Post by php1ic »

If you add "draft" to the options of \documentclass, only the bounding box of the figure will be printed

Code: Select all

eg change
\documentclass[a4paper]{report}
to
\documentclass[a4paper,draft]{report}
Don't know how to do it with tables.
ultimatesadness
Posts: 3
Joined: Thu Sep 03, 2009 3:13 pm

Re: Generate PDF without floats

Post by ultimatesadness »

Thanks, but I even don't want to see bounding boxes or captions ...
php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Generate PDF without floats

Post by php1ic »

Are you running on linux? This is not latex, but from the command line you could filter out all of the figure and table environments then compile the rest

Code: Select all

sed '/begin{figure}/,/end{figure}/ d' file.tex | sed '/begin{table}/,/end{table}/ d' > new_file.tex
you should now be able to run latex on new_file.tex to get a document with no figures or tables.
ultimatesadness
Posts: 3
Joined: Thu Sep 03, 2009 3:13 pm

Re: Generate PDF without floats

Post by ultimatesadness »

Thank you, I'll try this workaround.
But I would prefer a package to control it from within the tex-file.
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Generate PDF without floats

Post by josephwright »

You could look at the comment package, which makes environments into comments. That should enable you to temporarily "hide" whatever you want.
Joseph Wright
Post Reply