5

I am using the astronomy and astrophysics class aa.cls. I use it with either of the two options: structabstract or referee.

The first produces 2-column text, the second one-column text.

I have some figures that change appearance when I switch options.

I would like to know if it is possible to do something like this:

IF (optional argument equals structabstract) THEN

 {...commands to have the figure of a certain size}

ELSE (if optional argument equals)

 {...commands to have the figure of another size}

END IF

Could you help me please?

lockstep
  • 250,273
Mario
  • 51

2 Answers2

5

The referee option in your class is set up as

\DeclareOption{referee}{\let\if@referee\iftrue}

So you can test is with

 \makeatletter
  \if@referee TRUE CODE \else FALSE CODE \fi
 \makeatother

structabstract is set up as

 \DeclareOption{structabstract}{\@oldversionfalse}

So you could use \if@oldversion ...\else ...\fi. The options oldversion and traditabstract change this switch too. I didn't check the default of the switches.

Ulrike Fischer
  • 327,261
0

I prefer an alternate method that I have been using and is adapted from this answer to setting class options after documentclass, which has a few advantages:

  • does not rely on the internals of the class, so will work with any document class
  • allows you to change the options on the command line via latex '\def\MyClassOptions{referee}\input{doc}'

Code:

\expandafter\ifx\csname MyClassOptions\endcsname\relax
  \def\MyClassOptions{draft,twosided}
\fi
\documentclass[MyClassOptions]{article}
\usepackage{xstring}
\begin{document}
    \IfSubStr{\MyClassOptions}{draft}{%
        DRAFT option was used.%
    }{%
        DRAFT option was not used.%
    }%
\end{document}
Peter Grill
  • 223,288