5

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 ?

David Carlisle
  • 757,742

1 Answers1

4

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.

David Carlisle
  • 757,742
azetina
  • 28,884