Suppose I want to define a command, say,
\tree with, say, two arguments. I would like
\tree to do different things depending on what my first argument is. For example,
#1 = a, then return
#1 = b, then return "Hi"
Is it possible to realise the above pseudocode? If so, how can I?
You can also use
xstringpackage which can easily be extended to add more cases:
\PackageErrorif an unknown option is passed in.