It seems that the align
environment adds additional vertical space if it starts at the top of a page or minipage
. Below are two pages, and two minipage
s (on Page 1), where the first page/minipage
has text followed by an align*
environment, and the second page/minipage
starts with an align*
environment, and note that the equations are still aligned.
Attempted Solution:
The closest related question I found was:
I attempted to use the solution by Gonzalo Medina at the above by adding \setlength\abovedisplayskip{0pt}
(after the preamble as per Vertical space before and after align environment). Although, this did move the equations up vertically, they were still vertically aligned:
And since the problem occurs at top of a page as well, I don't think this is related to Understanding minipages - aligning at top
Question:
- How can I adjust the
align
environment to automagically not have additional space at the top of a page orminipage
? - Is there a reason for this behavior, and perhaps should not be changed?
Code:
\documentclass{article}
\usepackage[showframe,paperwidth=3.5in,paperheight=2.2in,margin=0.5in]{geometry}
\usepackage{amsmath}
\begin{document}%\setlength\abovedisplayskip{0pt}
Top of Page 1
\begin{align*}% Text above at top of page
e &= m c^2
\end{align*}
\hrule
\begin{minipage}[t]{0.45\linewidth}
Top of minipage 1
\begin{align*}% Text above this minipage
e &= m c^2
\end{align*}
\end{minipage}
\begin{minipage}[t]{0.45\linewidth}
\begin{align*}% No text above in this minipage
e &= m c^2
\end{align*}
\end{minipage}
\newpage
\begin{align*}% No text above at top of page
e &= m c^2
\end{align*}
\end{document}
\topskip0pt
at the preamble the issue goes away. – Yiannis Lazarides Dec 3 '11 at 4:39