[OS X TeX] Test whether an option has loaded

David Craig dac at panix.com
Fri Mar 2 08:27:32 CET 2012


> You're missing a backslash (should be \@classoptionslist), which is why the existence of preprint in the options list doesn't matter.

Hmmm.   When I try your suggested code (using versions), that seems to get the job done.  Your suggestion includes

\makeatletter
\IfSubStr{\@classoptionslist}{preprint}%
{\includeversion{ppversion}\excludeversion{finversion}}%
{\includeversion{finversion}\excludeversion{ppversion}}%
\makeatother

This actually works whether or not I include the backslash.    What function does it serve?

The way I was trying to do with ifthenelse it also works if I re-arrange it as in your example:

\IfSubStr{@classoptionslist}{preprint}%
{\newcommand{\pp}{1}}%
{\newcommand{\pp}{0}}%

(with or without the backslash), rather than making the outcome of \IfSubStr the argument of \newcommand itself.   I suppose \IfSubStr wants to run code, rather than simply output a value as I was imagining it would.

Thanks for the assistance!   This will come in very handy.

David Craig


<http://www.panix.com/~dac/>






More information about the macostex-archives mailing list