How can I create a command \if
with 1 argument, namely #1
,
\if{#1=1}{symbol1}...{#1=n}{symboln}
that returns symbol1
, when #1
is 1
, ..., and returns symboln
, when #1
is n
, and returns nothing, when #1
isn't 1,...,n
?
For example, I'd like to use the command
\if{#1=1}{\mapsto}{#1=2}{\mapsfrom}{#1=3}{\rightarrow}
when I'm defining a larger command.