# How to pass the draft option for pdfpages to \includegraphics?

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?

-

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}

-
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.

-