The ifthen Style Option

This option provides two programming language features that are useful only for people who already know how to program. It defines the two commands
 \ifthenelse{test}{then clause}{else clause}
\whiledo{test}{do clause}
that implement the following two Pascal language structures
 


if test then then clause 

else else clause
while test do do clause
The then, else, and do clauses are ordinary LATEX input; test is one of the following:

The test argument is a violently moving argument, which means that not only fragile commands but even some commands that are not normally fragile will break, causing TEX to enter an infinite loop. The \protect command works in these situations.

These commands, together with \renewcommand and the commands of Section C.7.4 for manipulating counters, open up a whole new world of hacking.