latex Defining macros

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

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?