I have a class file which declares some options. One of them is called draft. This places a watermark on all pages that says DRAFT.


I include the following line because I thought that it stops any declared options getting passed along when I call \LoadClass


Followed by

\LoadClass[a4paper, 12pt]{article}

However, whenever I pass the class my draft argument, it is getting passed to article, and getting rid of all my figures.

What am I doing wrong ?

  • 1
    Any option in the \documentclass line is passed to all packages loaded afterwards, including graphicx. You can avoid it by saying \usepackage[final]{graphicx} – egreg Oct 4 '12 at 12:45
  • 1
    You might find this question useful on removing options: tex.stackexchange.com/q/33245/86 – Andrew Stacey Oct 4 '12 at 12:47

Passing draft to article does not affect graphic inclusion. But global options are seen by all packages so a [draft] on \documentclass stops figure inclusion unless you use final on \usepackage[final]{graphicx} or on the individual calls \includegraphics[draft=false]{...} or use \setkeys{Gin}{draft=false} to reset the graphics draft flag.

| improve this answer | |
  • Your statement that "global options are seen by all packages" and egreg's "any option in the \documentclass line is passed to all packages" leave me confused, since the definition of \ProcessOptions says \@ifstar\@xprocess@ptions\@process@ptions and \@process@ptions doesn't copy class options. – Ahmed Musa Oct 4 '12 at 16:32
  • They are not passed down by the same mechanism but processoptions, if it is not handling a .cls file process the saved class options: \def\@process@ptions{% \@for\CurrentOption:=\@declaredoptions\do{% \ifx\CurrentOption\@empty\else \@expandtwoargs\in@{,\CurrentOption,}{% ,\ifx\@currext\@clsextension\else\@classoptionslist,\fi \@curroptions,}% \ifin@ \@use@ption \expandafter\let\csname ds@\CurrentOption\endcsname\@empty \fi \fi}% \@process@pti@ns} – David Carlisle Oct 4 '12 at 16:36
  • \ifx\@currext\@clsextension\else\@classoptionslist being the bit to stare at – David Carlisle Oct 4 '12 at 16:38
  • OK, seen it. Airheaded here. – Ahmed Musa Oct 4 '12 at 16:46

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.