no fair blaming this problem on align
. the same thing happens with equation
and no amsmath
. in the provided code, comment out \usepackage{amsmath}
and replace all instances of align*
with equation
(sorry, no *
available, so you'll get display numbers), and you'll get this result:
one gets the same result using \[ ... \]
only (as expected) without the numbers.
it's still a problem, but deeper in the guts of (la)tex.
[Note: the improvement below, actually does not work.]
[Note: there is an important improvement to this code below.]
The closest I can get to a solution is
\documentclass[10pt,a4paper]{article}
\usepackage{amsmath,amsthm,mathtools}
\begin{document}
\begin{proof}
\begin{align*}
15 &= 5+4+3+2+1 = \sum_{i=1}^5 i \\
120&=5\cdot4\cdot3\cdot2\cdot1 = 5! \\
\shortintertext{
\[ e^{\pi i} + 1 = 0 \]
\[ x^n + y^n = z^n \]
}
27 &= 3^3 \qedhere
\end{align*}
\end{proof}
\end{document}
which gives as result
and actually the spacing is quite nice, I think.
Failing important edit
I think the below code is nicer, and even gives better results.
\documentclass[10pt,a4paper]{article}
\usepackage{amsmath,amsthm,mathtools}
\begin{document}
\begin{proof}
\begin{align*}
15 &= 5+4+3+2+1 = \sum_{i=1}^5 i \\
120&=5\cdot4\cdot3\cdot2\cdot1 = 5! \\
\begin{gathered}
e^{\pi i} + 1 = 0 \\
x^n + y^n = z^n
\end{gathered}
27 &= 3^3 \qedhere
\end{align*}
\end{proof}
\end{document}
Credits go to barbara beeton (please vote up her comment on her own answer).
Best Answer
It has a pretty clear effect to me:
Can you provide a minimal working example where it doesn't?