I am trying to make a draft by forcing LaTeX to ignore all images. How do I tell LaTeX to suppress all the image filenames (in the \includegraphics command) and just insert an empty box? The problem with the [draft] options is that it still requires me to have all images in the folder where I have my .tex files.

migrated from stackoverflow.com Jun 29 '11 at 17:40

This question came from our site for professional and enthusiast programmers.

  • 1
    I took the liberty to change 'figure' to 'image' to avoid confusion with the figure environment. You apparently want only suppress the \includegraphics. – Martin Scharrer Jun 29 '11 at 17:47
  • Welcome to TeX.SX! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Martin Schröder May 30 '14 at 9:27

will give a black box for all images. All absolute width/height settings are recognized.

  • 13
    If graphicx is loaded by another package or document class (e.g. beamer) then you can add \PassOptionsToPackage{demo}{graphicx} before \documentclass to get around the option class error. – Seamus Jun 30 '11 at 11:25
  • but could it not read the width/height from the image, just replace the content with black? I did not use absolute settings and when preparing demo the sizes are messed up – Ciprian Tomoiagă Feb 6 at 10:18
  • use option draft. demo is only for testing a document where you do not have the image – user2478 Feb 6 at 11:12

The quickest way I can think of is to simply redefine the command:


will get you an empty box;


will get you a box with the intended filename inside it. If you need, say, a specific size box, you can mess around with similar boxmaking commands in place of \fbox until you have it doing what you need. But the important thing is: anytime you want a command to do something different than what it does, \renewcommand! :)

Your Answer

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