1

The latex file

\documentclass{leaflet}

\usepackage[draft]{graphics}

\begin{document}
test
\end{document}

produces an error: option clash with graphics package, whereas the following

\RequirePackage[draft]{graphics}

\documentclass{leaflet}

%\usepackage[draft]{graphics}

\begin{document}
test
\end{document}

does not. I infer that the class leaflet itself uses the graphics package. I think, this should be considered a bug or at least being documented.

Strange enough, the leaflet manual uses \usepackage{graphicx}.

  • 1
    Try giving the draft-option to the class. This should work (don't know the class, but if not, it's not that well created). – Skillmon Apr 6 '17 at 11:40
  • 1
    It is (kind of) documented, see last line on page 5 of the documentation. – user36296 Apr 6 '17 at 11:48
1

The graphicx package loads the graphics package, so this explains why there is an option clash with the explicitly loaded package. This also means that you don't have to load graphics yourself.

To pass the option draft to graphics (or graphicx, which has the same effect), use \PassOptionsToPackage.

\PassOptionsToPackage{draft}{graphicx}
\documentclass{leaflet}
\begin{document}
test

\includegraphics[width=3cm]{example-image}
\end{document}

Another possibility is to set the option draft for the whole document:

\documentclass[draft]{leaflet}

In this case the option applies to all loaded packages that implement such an option, among them graphics and graphicx. This may or may not be what you want. If you look just for a counterpart of \usepackage[draft]{graphicx}, then it is safer to use \PassOptionsToPackage.

  • you don't have to have a special line to pass the options. just start with \documentclass[draft]{leaflet}. it gets passed through. – barbara beeton Apr 6 '17 at 13:29
  • @barbarabeeton In general several packages may have an option draft, and one might not want to activate all draft options at the same time but only selectively the one from graphicx. Admittedly it may be difficult to find a real scenario where this occurs, but the exact (?) counterpart to \usepackage[draft]{...} is \PassOptionsToPackage{draft}{...}, therefore I prefer this solution. – gernot Apr 6 '17 at 14:06
  • thanks. that's a good argument and useful information. you might want to mention it in the answer -- someone just visiting casually might not read comments. – barbara beeton Apr 6 '17 at 14:08
  • @barbarabeeton Good point, I've added a note to my answer. – gernot Apr 6 '17 at 14:21
  • @barbarabeeton and @gernot: One package you might not want to get the draft option is for example scrlayer-scrpage. It'd add a printed ruler to every head- and footline. TADA! A real scenario :) – Skillmon Apr 6 '17 at 20:45

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.