3

I would like to define a new environment, which is based on a starred version of a LaTeX environment.

\newenvironment{eq}{\relax
Here is my unnumbered equation:
\begin{equation*}
}{
\end{equation*}
}

This all works nicely, except that the \begin{equation*} ... \end{equation*} confuses tools that check begin... end pairs are balanced. Had it been the non-starred version of the environment, I would have written:

\newenvironment{eq}{\relax
Here is my numbered equation:
\equation
}{
\endequation
}

But, what do I do to get the starred version of the environment without confusing tools? Yes, for equation I may have been able to use \[ ... \], but what do I do for any other environment?

3

1 Answer 1

3

\equation* which you could enter as \csname equation*\endcsname or by making * locally have catcode 11 (letter) so \equation* works. beware of white space control though, your suggested definition using \equation would add unwanted spaces, you need % and \ignorespacesafterend

2
  • 1
    you need to deal with the other -- multiline -- environments, which don't necessarily yield gracefully to being redefined as simple commands. Jan 13, 2017 at 19:04
  • 3
    @barbarabeeton the Op may have to. I don't :-) Jan 13, 2017 at 21:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .