I'm trying to define a variable conditional on the setting of a counter, with an optional argument. Specifically, in the example below, the variable
gOptshould return the second argument if the counter general is set to 1, and the first if the counter is set to
0. If only one argument is provided, and
general = 0, the default should be used.
This command works fine *if* only one argument is provided, but if two are provided,
#2, rather than choosing depending on the value of
If I use a
gAlt) then everything works ok, but I can't specify a default option.
Is this a bug in
\providecommand? Is there an easy way around the problem? Thanks very much for any advise.