[Tex/LaTex] Inconsistent vertical space after first \begin{equation*}

equationsspacing

The AlignBox environment from this TeX.sx answer can produce several consecutive equation* environments (when several pre-declared equation lines are inserted).

When the paragraph preceding the first equation* is more than one line long, the vertical spacing between the first and second equations is larger than for the others:

On this screenshot, the spacing between AAAAAA and BBBBBB is 74px, whereas it is 53px between BBBBBB and CCCCCC.

I'm curious about the reason this occurs (I noticed that when the line is very short, the equation is automatically moved up, to avoid an awkward large blank space).

Is there a workaround, or should I just adapt the macro to group consecutive equations into a gather* environment?

\documentclass{article}
\usepackage{amsmath}
\begin{document}

Hello hello hello hello hello hello hello hello hello hello hello
hello hello hello hello hello hello hello hello hello hello hello.
\begin{equation*}
  AAAAAA
\end{equation*}
\begin{equation*}
  BBBBBB
\end{equation*}
\begin{equation*}
  CCCCCC
\end{equation*}
\begin{equation*}
  DDDDDD
\end{equation*}

\end{document}

Best Answer

The larger space is \belowdisplayskip which is used for the first equation. You could locally set it to \belowdisplayshortskip. But some multiline display environment is probably better:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
Hello hello hello hello hello hello hello hello hello hello hello
hello hello hello hello hello hello hello hello hello hello hello.%
\begingroup\belowdisplayskip=\belowdisplayshortskip
\begin{equation*}
  AAAAAA
\end{equation*}\endgroup
\begin{equation*}
  BBBBBB
\end{equation*}
\begin{equation*}
  CCCCCC
\end{equation*}
\begin{equation*}
  DDDDDD
\end{equation*}

\end{document}

enter image description here

Related Question