latexDefining macros


Syntax

  • \newcommand{\macro}{replacement text}
  • \newcommand{\macro}[argcount]{replacement text}
  • \renewcommand{\macro}{replacement text}
  • \renewcommand{\macro}[argcount]{replacement text}

Parameters

ParameterDetails
\macroThe macro to define
argcountThe number of arguments the macro expects (optional)
replacement textThe replacement text for the macro. Inside that text #1, #2 etc. are replaced with the macro arguments.