8.5 displaymath

Synopsis:

\begin{displaymath}
  mathematical text
\end{displaymath}

Environment to typeset the mathematical text on its own line, in display style and centered. To make the text be flush-left use the global option fleqn (see Document class options).

In the displaymath environment no equation number is added to the math text. One way to get an equation number is to use the equation environment (see equation).

LaTeX will not break the math text across lines.

The amsmath package defines an equation* environment which is functionally identical to displaymath but allows use of other amsmath facilities. In general, amsmathhas significantly more extensive displayed equation facilities. For example, there are a number of ways in that package for having math text broken across lines; see also the breqn package for that (https://ctan.org/pkg/breqn).

The construct \[ math \] is a synonym for the environment \begin{displaymath} math \end{displaymath} but the latter is easier to work with in the source; for instance, searching for a square bracket may get false positives but the word displaymath will likely be unique.

The construct $$math$$ from plain TeX is sometimes used instead of LaTeX’s displaymath. Although the output is similar, but is not officially supported in LaTeX at all; $$ doesn’t support the fleqn option, has different vertical spacing, and doesn’t perform consistency checks.

The output from this example is centered and alone on its line.

\begin{displaymath}
  \int_1^2 x^2\,dx=7/3
\end{displaymath}

Also, the integral sign is larger than the inline version \( \int_1^2 x^2\,dx=7/3 \) produces.


Unofficial LaTeX2e reference manual