Child pages
  • Custom commands with inputs
Skip to end of metadata
Go to start of metadata

You will probably know how to define a custom command, but one with inputs seems not to be straightforward from the documentation. This is probably most easily explained with an example:


\newcommand{\D}[2]{\frac{\partial #1}{\partial #2}}

\D is the name given to the new command
[ 2 ] is the optional number of input arguments for the command
#1 is the place where the first input argument will be placed
#2 is the place where the second input argument will be placed, etc

Example use:


will produce an output that looks like

LaTeX Markup problem

Show/Hide latex markup

Show/Hide latex error

  • No labels