[texhax] The Optional usage of the Packages

zoran.nikolic at ubs.com zoran.nikolic at ubs.com
Thu Aug 16 15:48:33 CEST 2007


Ah, now I understand, thanks a lot!!!

Best Regards,

Zoran 

-----Original Message-----
From: Lars Madsen [mailto:daleif at imf.au.dk] 
Sent: Donnerstag, 16. August 2007 15:45
To: Nikolic, Zoran
Cc: support at tug.org
Subject: Re: [texhax] The Optional usage of the Packages

zoran.nikolic at ubs.com :

>
> Hello Folks,
>
> I really apologize to contact you directly
> but I realy went over everything I found on the web about my issue...
>
> The aim:
> Depending on the options passed to my class, I'd like
> a various packages to be used or not used - checkout what I tried...
>
> \NeedsTeXFormat{LaTeX2e}
> \ProvidesClass{sciencearticle}[2007/08/15 The Science Article Class]
>
> \DeclareOption{chem}
>  {
>    \typeout{Providing packages for the Chemistry}
>    \RequirePackage[version=3]{mhchem}
>  }
> \DeclareOption{chemext}
>  {
>    \typeout{Providing packages for the Chemistry - Extended}
>    \RequirePackage[version=3]{mhchem}
>    \RequirePackage{epic}
>    \RequirePackage{chemstr}
>    \RequirePackage{carom}
>    \RequirePackage{hetarom}
>    \RequirePackage{hetaromh}
>    \RequirePackage{lowcycle}
>    \RequirePackage{ccycle}
>    \RequirePackage{hcycle}
>    \RequirePackage{aliphat}
>    \RequirePackage{locant}
>    \RequirePackage{polymers}
>    \RequirePackage{methylen}
>    \RequirePackage{fusering}
>    \RequirePackage{sizeredc}
>  }
>
> \ProcessOptions\relax
> \LoadClass[a4paper, twoside, 11pt]{article}
>
> This is not working and the message is:
> ! LaTeX Error: \RequirePackage or \LoadClass in Options Section.
>
> Could somebody please help me on how to bind the packages
> optionally.
>
> Many thanks in advance
>
> Zoran Nikolic
>
>

create switches, i.e. if constructions, use the option deplarations to
set 
the vaiable to 'true' and then later do a

\ifchemext
...load packages...
\fi


/daleif


More information about the texhax mailing list