# LaTeX Definitions

Defining or redefinig commands and environments can be done by them.


  \newcommand{cmd}[args]{def}
\renewcommand{cmd}[args]{def}

These commands define (or redefine) a command.
• args An integer from 1 to 9 denoting the number of arguments of the command being defined. The default is for the command to have no arguments. Arguments are denoted in the substitution text as #1, #2, etc, #9
• def The text to be substituted for every occurrence of cmd; a parameter of the form #n in cmd is replaced by the text of the nth argument when this substitution takes place.

### \newenvironment, \renewenvironment

 \newenvironment{nam}[args]{begdef}{enddef}
\renewenvironment{nam}[args]{begdef}{enddef}

These commands define or redefine an environment.
• nam The name of the environment. For \newenvironment there must be no currently defined environment by that name, and the command \nam must be undefined. For \renewenvironment the environment must already be defined.
• args An integer from 1 to 9 denoting the number of arguments of the newly-defined environment. The default is no arguments.
• begdef The text substituted for every occurrence of \begin{name} or \begin{name}{arg1, arg2, }; a parameter of the form #n in cmd is replaced by the text of the nth argument when this substitution takes place.
• enddef The text substituted for every occurrence of \end{nam}. It may not contain any argument parameters.

### \newtheorem

  \newtheorem{env_name}{caption}[within]
\newtheorem{env_name}[numbered_like]{caption}

This command defines a theorem-like environment.
• env_name The name of the environment -- a string of letters. Must not be the name of an existing environment or counter.
• caption The text printed at the beginning of the environment, right before the number.
• within The name of an already defined counter, usually of a sectional unit. Provides a means of resetting the new theorem counter within the sectional unit.
• numbered_like The name of an already defined theorem-like environment.
The \newtheorem command may have at most one optional argument.

### \newfont

 \newfont{cmd}{font_name}

Defines the command name cmd, which must not be currently defined, to be a declaration that selects the font named font_name to be the current font.