I want to define a \newcommand with two argument, of which one is optional, which allow me to have the same output of the first input in the case I do not specify the second argument, while being the second argument if specified. Let make an example:
\newcommand{\paren}[1]{\left(#1\right)} %this is just an example command
$A = a\paren{a}$
I want to obtain the same by doing something like (this won't work)
\newcommand{\mypar}[2][#1]{#2\paren{#1}}
$A = \mypar{a} = \mypar[a]{a} \neq \mypab[b]{a}$
I thought that inserting #1 as default argument when the second argument was not specified would have done the job, but it didn't.




\@dblargacts? What is it doing? – GiuTeX Nov 08 '17 at 20:28