TeX/else

Description
The \else command is used to include the optional else construct of TeX's many if-then-else control structures which include:
 * \if
 * \ifcase
 * \ifcat
 * \ifdim
 * \ifeof
 * \iffalse
 * \ifhbox
 * \ifhmode
 * \ifinner
 * \ifmmode
 * \ifnum
 * \ifodd
 * \iftrue
 * \ifvbox
 * \ifmode
 * \ifvoid
 * \ifx

The use of each of these take the form \if*  \else  \fi where \if* is one of the commands listed above, are all the arguments, if any, required by \if*, and  and  are each a piece of TeX code. The code "\if* " either evaluates to true of false; if true then TeX processes  and ignores ; if false then TeX ignores  and processes .

Examples
Consider the code \ifmmode \mathcal{A} \else $\mathcal{A}$ \fi \ifmmode tests whether TeX is in one of the math modes; it does not require any arguments, and so is blank. If TeX is in one of the math modes then \ifmmode evaluates to true. So if the above code were used in math mode, then the expression as a whole would reduce to "\mathcal{A}", otherwise "$\mathcal{A}$".

Now consider \ifodd2 odd \else even \fi In this case \ifodd requires an argument that evaluated to an integer. "\ifodd2" evaluates to false, and so the TeX will typeset the word "even".