latex Defining macros

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

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.


Got any latex Question?