# [texhax] less gap text/display math when almost empty

Sun Oct 3 12:49:48 CEST 2004

Alexandru Scorpan :

> Is there, by any change, a package that adjusts spacing of display math, when
> the line before is almost empty, and the display math line has only stuff in
> its center?  In other words, when the math material is not directly below the
> text of the preceding line.
> It gets tiresome to manually add \vspace*{-.5\baselineskip} to adjust, and it
> seems like something that might have bothered people before...
>
> -- Alex
>

It does. A problem might be either accidentally starting a new paragraph
just before the equation or using one of the amsmath envs for oneliners
(sadly envs such as align or gather are full display envs and doesn't look
at the text line just above. Example (the change in spacing can be sees
in the vertical distance between the 'text's):

\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}
\noindent text
$a=b$
text
\begin{displaymath}
a=b
\end{displaymath}
text
$$a=b$$
text
\begin{equation*}
a=b
\end{equation*}
text
\begin{align*}
a=b
\end{align*}
text
\begin{gather*}
a=b
\end{gather*}
text
\end{document}

--

/daleif

You cannot help men permanently by doing for them
what they could and should do for themselves. ''
-- Abraham Lincoln