Code: Select all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareOption{xray}{
%....code that requires package color and multicol...
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ProcessOptions\relax
\LoadClassWithOptions{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{optional}
%...
\IfDeclaredOption{xray}{% A construct such as this is what I'm after
\RequirePackage{multicol}
\RequirePackage[usenames,dvipsnames]{color} %. Thanks David Carlisle
}
Code: Select all
\RequirePackage
Code: Select all
\DeclareOption
I've tried optional, comment, and the ifx packages, and have failed to get this working, mainly because they don't seem to compile correctly if I try and use them after the Options section of the LaTeX document.