Next: Normalising spacing Up: Miscellaneous commands, etc Previous: The `openany' option in Contents

## Better user-defined math display environments

`\ignorespacesafterend`

Suppose that you want to define an environment for displaying text that is numbered as an equation. A straightforward way to do this is as follows:

      \newenvironment{texteqn}
        {\begin{equation}
           \begin{minipage}{0.9\linewidth}}
          {\end{minipage}
         \end{equation}}

However, if you have tried this then you will probably have noticed that it does not work perfectly when used in the middle of a paragraph because an inter-word space appears at the beginning of the first line after the environment.

There is now an extra command (with a very long name) available that you can use to avoid this problem; it should be inserted as shown here:

      \newenvironment{texteqn}
        {\begin{equation}
           \begin{minipage}{0.9\linewidth}}
          {\end{minipage}
         \end{equation}
         \ignorespacesafterend}