Commands with optional arguments

From Wiki
Revision as of 08:18, 4 August 2004 by Peter (talk | contribs) (first version)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In LaTeX you define a new command with an optional argument with "newcommand":

\newcommand{\MyCommand}[2][World]{{#2Hello #1!}}
\MyCommand{\bfseries}
\MyCommand[Hans]{\scshape}

ConTeXt:

There is perhaps a way to do the same. Otherwise, the key value method is preferred, see Define Commands.