Let us have a look at the following minimal example:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
This is the first line.
% \begin{gather*} x^2 + y^2 = z^2. \end{gather*}
\begin{displaymath} x^2 + y^2 = z^2. \end{displaymath}
This is the second line.
\end{document}
If uncomment the displaymath and comment the gather* part, then the vertical spacing changes: the AMS math environment takes up space much more generously.
I know that the AMS environments have adaptive vertical spacing to some extent, but I don't know how much. I don't know whether the plain display math environment ever adapts or is just set a minimum.
I can imagine a situation, such as where the article is supposed to be within a page limit and using either of these environments, depending on their vertical spacing behavior, may lead to problems.
Q: What are the rules that governs the vertical spacing in plain displaymath and AMS math environments?
$$,\[,align,equationanddisplaymath? – Mico Sep 24 '23 at 05:59amsmathpackage (such asalignandgather) for single-line display math material"? Incidentallly, what's the basis for your claim that "the AMS environments have adaptive vertical spacing to some extent"? – Mico Sep 24 '23 at 06:03