I'm trying to define a command that will take 3 arguments each one possibly empty. An empty argument will slightly modify the output. Let me give a non-working example :
\newcommand{\foo}[3]{
\textbf{bar}(
\ifthenelse{\isempty{#1}}
{}
{#1, }
#2)
\ifthenelse{\isempty{#3}}
{}
{\cap #3}
}
And this is what I would like to get :
\foo{a}{b}{c}
=>\foo{}{b}{}
=>\foo{}{b}{c}
=>
But obviously it doesn't work. I'd like, as much as possible, to call this function with only one type of bracket (since I will always write the 3 pairs of bracket even if they are empty). As far as I'm concern, I consider that there's no optional arguments in it, only mandatory arguments that are possibly empty. I pretty sure I'm not doing things right but I really don't get the idea of this \newcommand
function.
Thanks for any help.