On 09/27/2012 05:45 PM, Sietse Brouwer wrote:
Hi all,
As I understand it, \define[2] is preferred over \def#1#2 because it
refuses to overwrite existing commands.
\define[2]\mycommand{code code code}
defines a command to be invoked with
\mycommand{...}{...}
Can I use \define, or a related command, to define a command that
takes square-bracket arguments, like so:
\mycommand[...][...]
?
When I type
\define[1][2]\mycommand{code code code}
that doesn't work.
Cheers,
Sietse
_______
You know the wiki better than most, but I wonder: are you looking for
this page?
http://wiki.contextgarden.net/Commands_with_optional_arguments
Thomas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________