Help On LaTeX \newenvironment

# Hypertext Help with LaTeX
\newenvironment

`\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, nor may the command `\nam` be currently defined. For `\renewenvironment` the environment "`nam`" must already be defined. `nam` may contain letters, numbers, and asterisks; it may not begin with "end...".

- `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{nam}`; a parameter of the form `#n` in `begdef` 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.

## Changes in LaTeX2e

It is possible to have an optional argument, the form of the command being

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

If `opt` is present, the first of the `args` arguments is optional with default value `opt`. If it is absent all arguments are mandatory.

See also Defining commands, Environments
Go to LaTeX Table of Contents