[texhax] How to structure conditionals?
karl at freefriends.org
Sun Oct 23 20:48:49 CEST 2005
\thequestionnum) #1 #2
I'm not sure from your description how you intend \question to be
called. Could you give an example?
But I can't for the life of me figure out how to put in a
conditional, either checking a defined string at the beginning
I don't know how to use LaTeX conditionals, but the primitives \if and
\ifx can check these things, or maybe \ifcase would be better. For
example, you gave this example:
tells TeX "when you're in the first question, use the second question
conclusion; when you're in the second question, use the second question
conclusion; when you're in the third question, use the first question
And here is a sketch of some code, assuming some other counter like
\conclusion to tell you which conclusion to use.
% q0, impossible
\or \conclusion=2 % q1
\or \conclusion=2 % q2
\or \conclusion=1 % q3
Hope this helps,
More information about the texhax