I saw these command when i searching sth. I wonder if we can increase numbers if conditions.
it's like if{0} = a, if{1}=b, if{2}=c, if{3}=d etc.
\newcommand{mycommand}[1]{
\if{#1 != 0}
Some text, because it's nonzero
\else
Some other text, because it's zero
\fi
}
\mycommand{0}
\mycommand{1}
Best Answer
You can do much better: a
\newcasecommand
that can deal with arbitrary labels, not only numbers.The syntax is
The final argument is optional; the default is printing an informative text, which could be turned into a warning.