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.

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.

\DeclareOption{draft}{  
    \RequirePackage{draftwatermark}
    \SetWatermarkText{\textbf{DRAFT}}
}

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

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}

Followed by

\ProcessOptions\relax
\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 ?

share|improve this question
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 –  Loop Space Oct 4 '12 at 12:47
add comment

1 Answer 1

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[final]{...} or use \setkeys{Gin}{draft=false} to reset the graphics draft flag.

share|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
add comment

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.