# How to use a math environment without the vertical extra space? [duplicate]

Possible Duplicate:
Remove vertical space around align

I would like to center two text lines with equations. Normally, one can do that with the align* environment. But I do not want the extra vertical space at the top and the bottom of the formulas (see example below).

An alternative could be to simply center the formulas with \centerline. But then, the two equation symbols will not be placed one below the other.

Here is an example:

\documentclass[a4paper]{article}
\usepackage{amsmath}

\begin{document}
text before % Extra space after this line
\begin{align*}
1 &= 1 \\
x &= \text{here is a long formula}
\end{align*}
text after % Extra space before this line

text before \\
\centerline{$1 = 1$} \\ % equation symbols not below each other
\centerline{$x = \text{here is a long formula}$} \\
text after
\end{document}


Is it possible to use align* without the extra vertical space ?

If not, what could be another solution ?

-

## marked as duplicate by Gonzalo Medina, Kurt, Harish Kumar, Qrrbrbirlbel, Heiko OberdiekOct 22 '12 at 3:38

Have you considered editing the \abovedisplayskip? –  azetina Oct 22 '12 at 0:34

Add the following lines of code:

{\setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\begin{align*}
1 &= 1 \\
x &= \text{here is a long formula}
\end{align*}}


Enclosing the above in {} ensures that the display break adjustments are made local and not global.

-