TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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}


Could you help me please?

share|improve this question
Related question (no exact duplicate, though): How do I conditionally execute something based on a documentclass option? – diabonas Mar 7 '12 at 11:16
The easiest way might be to define the figure width in terms of \columnwidth: \includegraphics[width=.8\columnwidth]{filename}, for instance. – egreg Mar 10 '12 at 10:56

The referee option in your class is set up as


So you can test is with

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

structabstract is set up as


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.

share|improve this answer

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}'


\expandafter\ifx\csname MyClassOptions\endcsname\relax
        DRAFT option was used.%
        DRAFT option was not used.%
share|improve this answer
This is suited to personal use only. Please don't create a package for users in this way. – Ahmed Musa Mar 11 '12 at 2:42
@AhmedMusa: I don't see anything in the question indicating that the question is for creating a package. – Peter Grill Mar 11 '12 at 5:24

Your Answer


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.