I am editing a rather long text which contains many equations and floats, and encountered a problem with the align
and gather
environments.
MWE:
\documentclass[preview]{standalone}
\usepackage{amsmath}
\begin{document}
Paragraph one. Lorem ipsum dolor sit amet, consecuteur adipiscing elit.
\begin{gather*}
\boxed{\sum_{x=1}^{N} A_x} \\
\boxed{\sum_{x=1}^{N} A_x}
\end{gather*}
Paragraph two. Lorem ipsum dolor sit amet, consecuteur adipiscing elit.
\end{document}
Result:
There is too much vertical space between the first paragraph and the equation, as if an extra empty paragraph was inserted. If I delete the blank line between the first paragraph and the math environment, there is no extra space, but the page can't be broken at that point and I often I end up with orphans. The extra space is not present when I use the equation
environment or \[ \]
:
\documentclass[preview]{standalone}
\usepackage{amsmath}
\begin{document}
Paragraph one. Lorem ipsum dolor sit amet, consecuteur adipiscing elit.
\[ \boxed{\sum_{x=1}^{N} A_x} \]
\[ \boxed{\sum_{x=1}^{N} A_x} \]
Paragraph two. Lorem ipsum dolor sit amet, consecuteur adipiscing elit.
\end{document}
Result:
How can I get rid of the unwanted vertical space, but at the same time allow page breaks before the environment?
\allowdisplaybreaks
in the document preamble, but never leave a blank line before a display.\allowdisplaybreaks
, then pages can start with fragments of equations. Why not also allow them to start with complete equations too?