So this is something I've wondered about for a while. What use is a conditional that always evaluates to false? I guess it's a neat way to "hide code from LaTeX" but apart from that, is it ever useful?
|
Knuth's own answer to this is quite instructive: on p.211 of the TeXbook, he describes the evolution of the
Clearly, these have the same effect (in principle) as
I have inserted parentheses to show intent. If the Thus, The tradition of tautologic in programming has a bit of a history: there are (The |
|||||
|
|
The following definitions are accepted by TeX:
and, in expansion contexts, they can be used to make TeX see an opening and a closing argument delimiter; I've used this idea to build continuous fractions using a syntax
without the need for the user to ensure brace matching. The main usage is, however, in the definition of new conditionals. When one says
(where
actually defines the two commands
so that Other programming styles don't use them; for example conditionals in LaTeX3 are of the form
so that there's no explicit conditional nesting (but there's argument nesting). Note that also |
|||||
|
|
Every You usually don't use When you want to change |
|||
|
|
|
It can be useful to make a complex macro do different things based on a conditional switch. In the following, the conditional is not so complex.
|
|||||||
|
|
I guess you know it but …
|
|||
|
|
|
the usual answer for this kind of question is to see Victor Eijkhout's book, TeX by Topic
( |
|||
|
|
\let\iffoo\iffalse. – Leo Liu Mar 1 '12 at 15:37