latex newcommand
\documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \newcommand{\aut}[2]{#1~\textsc{#2}} \begin{document} \aut{Pierre}{Durant} \end{document}
Source: www.developpez.net
newcommand latex
\newcommand{\plusbinomial}[3][2]{(#2 + #3)^#1} %we have 3 params, % and 2 is the optional value of the 1st param To save some time when writing too many expressions with exponents is by defining a new command to make simpler: \[ \plusbinomial{x}{y} \] And even the exponent can be changed \[ \plusbinomial[4]{y}{y} \] %here we override the optional val of the 1st param with the 4
Source: www.overleaf.com
newcommand latex
\newcommand{commandName}[#ofParams]{commandDefinition} # Where in the 'commandDefinition', use #1, #2, ... to represent # first, second, ... argument
newcommand latex
If you use a command multiple times create e shortcut, like for example: ... \newcommand{\be}{\begin{equation}} \newcommand{\ee}{\end{equation}} ... \begin{document} ...