Search found 1 match

by gizzmo
Wed May 09, 2012 2:45 am
Forum: General
Topic: New Command with one or two Arguments
Replies: 2
Views: 10242

New Command with one or two Arguments

Hi, I am trying to define a command that would take one or two arguments. One should be mandatory and the other one not. This is what I have right now
\newcommand\braket[2][]{\langle\ifx\@empty#2#1\else#1\lvert#2\fi\rangle}
The desired behaviour is that:

\braket{a} gives me \langle a \rangle ...