Commands with optional arguments
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.