Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 18 down vote accepted

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.

share|improve this answer
7  
Your second and third paragraphs seem in opposition. –  Ryan Reich Nov 22 '10 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 '10 at 19:56
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.