Is it possible to prevent the contents of a figure from being rendered? I have a large book document, and to speed up compiling while working on a draft, I would like to have some way of ignoring the content of the images, but ensuring that the figure size remains.

In several cases I am using a line like:


so I do not know the actual size of the image.


You can either give the draft flag to the documentclass which has other implications as it gives the draft option to packages called (although some of them may ignore it).

Alternatively, calling the graphicx package with the draft option should just do what you want.




If however, while in draft mode you want to see one of the graphics without adding them all in the output, you can unset the draft mode on a per file basis by setting draft to false as follows:

| improve this answer | |
  • 1
    perfect. Thanks, I did not realize that \usepackage[draft]{graphicx} handled the image size. – celenius Apr 14 '12 at 14:01
  • 6
    @celenius: It still reads the correct image size from the image files and generates a dummy placeholder with the same size. There is also the demo option which will not look for any images files and insert some fixed-size replacement. – Martin Scharrer Apr 14 '12 at 14:04
  • 1
    For more on the demo option, please see tex.stackexchange.com/questions/21924/… – Ioannis Filippidis Aug 14 '14 at 2:22
  • The option [draft]clashes with several other packages like colordvi` and verbatim... – Xi'an Oct 13 '15 at 11:46
  • @Xi'an where did you apply the option for it to clash? the class? the package or the graphic itself? what are the effects of said clash? – ArTourter Oct 13 '15 at 13:52

You can use the package draftfigure to get the same result and modify the display of the switched off figure:




\setdf{content={This figure is switched off.}}


enter image description here

| improve this answer | |
  • This was the easiest option for me. \usepackage[draft]{graphicx} didn't work, probably because of some extra packages and \documentclass[draft]{article} disabled other things like hyperlinks. – Laurens Meeus May 27 '19 at 10:21

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.