Is it possible to build a macro with an optional parameter enclosed in round brackets () rather than square brackets, where one can say for example:
\mymacro(){}{}
or
\mymacro{}{}
|
Is it possible to build a macro with an optional parameter enclosed in round brackets
or
|
||||
|
|
|
A more traditional solution! To build a command with any optional parameter, as you find in many of LaTeX's commands, you will need two things: (a) a macro with delimited parameters (b) a way to grab the first non-space token that follows the command The first part is fairly easy using delimited argument macros, for example we can say
We can then call this macro as:
resulting in To define the For this we can use the As for example we can redefine the LaTeX code for
and the full example would look like:
|
|||||
|
|
A simple
or if you want an empty
(This works as |
|||
|
|
|
|||
|
|