3

I'm trying to compile a draft of my .tex document, leaving out all the figures. The answer given here, ie:

\usepackage{comment}
\excludecomment{figure}
\let\endfigure\relax

works for images included in a \begin{figure} block, but not for a \begin{figure*} one.

I tried adding a \excludecomment{figure*} line to the above block, but I get an error:

Extra }, or forgotten \endgroup. [\end{figure*}]

How can I exclude all images from the final PDF?

3

I believe that this should work, but it's untested (you have not provided a minimal (non-)working example; if it does not work, let me know and I'll delete the answer; or, provide a MWE):

\usepackage{comment}
\excludecomment{figure}
\let\endfigure\relax
\expandafter\let\csname figure*\endcsname\figure
\expandafter\let\csname endfigure*\endcsname\endfigure

The problem is that you can't work with names containing * out of the box. This is a "hack" to make the figure* environment do exactly the same as figure.

  • 1
    Works perfectly yo', thank you very much! (Sorry for not posting a MWE, will try not to be so lazy next time) – Gabriel Feb 23 '16 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.