Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

If I use

\usepackage[draft]{pdfpages}

and include

\includepdf[...]{...}

everything works fine, i.e. instead of the included pages I get empty boxes. But if I use

\includegraphics[...]{...}

the actual picture is included. I cannot separately load "graphicx" because it is already loaded by "pdfpages".

How can I pass the draft option to \includegraphics?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

You can use \PassOptionsToPackage:

\PassOptionsToPackage{draft}{graphicx}
\documentclass{article}
\usepackage[draft]{pdfpages}

or you can use draft as a class option

\documentclass[draft]{article}
\usepackage{pdfpages}
\usepackage{graphicx}

and it will be picked by pdfpages and graphicx. Another option would be to load graphicx before pdfpages, so you can use the desired option:

\documentclass{article}
\usepackage[draft]{graphicx}
\usepackage[draft]{pdfpages}
share|improve this answer
    
Is there any way to be able to toggle only one "draft switch"? –  Aton Oct 22 '12 at 3:09
    
@Aton perhaps my updated answer is what you are asking for? –  Gonzalo Medina Oct 22 '12 at 3:13
    
Perfect, thanks! –  Aton Oct 22 '12 at 3:20
\usepackage[draft]{graphics} % or \usepackage[draft]{graphicx}
\usepackage[draft]{pdfpages}

LaTeX does not load packages more than once. Loading the package graphics the first time, enables draft mode. Package pdfpages loads graphicx and graphicx loads graphics without options each, thus LaTeX will not complain. The important thing is that the superset of all options specified in all load requests must be present at the first loading of the package.

Other alternatives are given in Gonzalo Medina's answer:

  • Global option draft is seen by packages graphics and graphicx.

  • Calling \PassOptionsToPackage before the first loading of graphics or graphicx.

Key value setting

And yet another way is possible:

\usepackage[draft]{pdfpages}
\setkeys{Gin}{draft}

Package graphicx adds a key value interface for some of the options. draft can be set and unset later:

\setkeys{Gin}{draft}
... \includegraphics{...} ...
\setkeys{Gin}{draft=false}
... \includegraphics{...} ...

Or the option can be set explicitly in \includegraphics:

\includegraphics[draft=false]{...}

However final is not defined this way. This option can only be used as package option.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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