# [texhax] How to structure conditionals?

Chris Bergstresser chris at subtlety.com
Sun Oct 23 08:47:26 CEST 2005

```Hi all --

I'm using TeX to create a survey for a psychology experiment, which
means I have a several different conditions.  For example, one version
of the survey might have the following:

1) Do you like to eat beets?
2) Do you like to drink milk?
3) Can you dance the rumba?

While another version of the questionnaire might have the following:

1) Do you like to eat potatoes?
2) Do you like to drink milk?
3) Can you dance a polka?

In other words, each question comes in a couple different
varieties.  To produce different versions of the questionnaire, I'd like
to specify (at the beginning of the file) something simple, which 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
conclusion".

I've gotten as far as this:

\newcommand{\question}[3]{
\samepage{}
\thequestionnum) #1 #2
}
\newcounter{questionnum}