1

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}
Suzanne Soy
  • 3,043
  • @Dario Do you mean leaving a blank line? These answers seem to indicate that it would start the equations at the beginning of a paragraph, which is bad practice. Also, I'd prefer having the first space smaller, rather than have the others larger. Thanks for the idea, though! – Suzanne Soy May 11 '16 at 15:37
  • Duperon. Yes this is what I mean. I just posted the MWE. I know it is not really great solution, but it seems to work. – Dario May 11 '16 at 15:39
  • 2
    Never leave a blank line before a displayed equation, or use two consecutive equations. Use an environment for a multiline display such as align or multline from amsmath – David Carlisle May 11 '16 at 15:41

2 Answers2

2

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

Ulrike Fischer
  • 327,261
0

Not a nice solution, but it might work (just leave space between \end{} and \begin{}:

\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}

This is what I get: enter image description here

Dario
  • 1,340