I have seen several related questions, but none seems to address specifically this.
I would like to define a command that accepts a variable number of arguments. Something like
\newcommand{\func}(1){\if{#1}{f(#1)}{f}}
So that if there is a parameter the output will be f(#1)
and if there is no parameter the output will be f
, and never f()
.
Is this possible?
Best Answer
The
xparse
package allows for some really cool syntax stuff.