25

The amsmath documentation says

Basic LaTeX doesn’t provide an equation* environment, but rather a functionally equivalent environment named displaymath.

Are they really the same or is there a catch? Maybe in interaction with some other packages?

2 Answers 2

22

Their effect is similar but they are differently programmed. equation* builds on amsmath macros and is therefore more compatible to other amsmath environments and commands.

For instance, within LaTeX's displaymath environment you cannot use a split environment, even if you loaded amsmath. But within equation* it's possible.

amsmath redefines \displaymath such that it uses equation*. That means, after you loaded amsmath, there won't be a difference any more between those two environments. Further, LaTeX's displaymath is fragile, amsmath makes it robust.

To see that, here are two lines of latex.ltx:

\def\displaymath{\[}
\def\enddisplaymath{\]\@ignoretrue}

And these two lines are at the very end of amsmath.sty:

\DeclareRobustCommand{\[}{\begin{equation*}}
\DeclareRobustCommand{\]}{\end{equation*}}

To sum up, if you use amsmath, which is very recommendable for math texts, you don't need worry about \displaymath.

2
  • 7
    Your second and third paragraphs seem in opposition.
    – Ryan Reich
    Nov 22, 2010 at 19:52
  • 3
    @Ryan: it's for the case that one really would like to use the original displaymath environment instead of the one of amsmath. It's possible to save it to another name and use the original one together with amsmath. Then we could see the difference and the incompatibility.
    – Stefan Kottwitz
    Nov 22, 2010 at 19:56
2

You can find the relevant definitions in Section 55.2 of source2e.pdf and lines 2523–2667 of amsmath.sty LaTeX aliases \begin{displaymath} to \[ and \end{displaymath} to \], where \[ and \] are wrappers around $$ with some checks. amsmath redefines \[ to \begin{equation*} and \] to \end{equation*}, which in turn wraps around $$ with some checks. So they do the same thing, and as Stefan notes, once you load amsmath, they literally do the same thing.

You must log in to answer this question.

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