4
\documentclass[a4paper, 11pt]{report}
\usepackage[left = 2cm, right = 2cm, top = 3cm, bottom = 3cm]{geometry}
\usepackage{amsmath}
\begin{document}
1111111111111111111111111111111111111111111111111111111111111111111111
\begin{align}
2 + 2 + \frac{1}{2}
\end{align}
2222222222222222222222222222222222222222222222222222222222222222222222
% \vspace{21.393cm}\\ GG
\end{document}

This is good output. However, when the second last line is uncommented, the equation and its surrounding are compressed a lot!

How do I make latex completely stop this compressing and go to new page if needed?

Coolwater
  • 233
  • Are you perhaps wanting \vfill instead of \vspace{21.393cm}`? – egreg May 23 '15 at 12:35
  • @egreg In my real document I have a page with several equations. At the bottom, however, it ends with mostly text. When I add more text, it keeps reducing the spacing about the equation rather than go to new page. vspace is no part of the real document. – Coolwater May 23 '15 at 12:39
  • @Coolwater: Please provide something that reproduces the problem. That way we can address the problem more accurately. – Werner May 23 '15 at 12:43
  • @Werner When you compile the code, don't you experience a different spacing about the equation when including/excluding the vspace? – Coolwater May 23 '15 at 12:44
  • Add \pagebreak[0] (or \pagebreak[n] where n is from 1 to 4, the value 4 will force a page break) at an appropriate spot, if you feel that a page break appears in a bad place. Do it only when the document is in final form for the text. – egreg May 23 '15 at 13:52

1 Answers1

6

The problem you're experiencing is due to glue above/below a math display. If you remove the glue, the display is set consistently:

enter image description here

\documentclass[a4paper, 11pt]{report}
\pagestyle{empty}
\usepackage[left = 2cm, right = 2cm, top = 3cm, bottom = 3cm]{geometry}
\AtBeginDocument{%
  \setlength{\abovedisplayskip}{\dimexpr\abovedisplayskip}
  \setlength{\belowdisplayskip}{\dimexpr\belowdisplayskip}
  \setlength{\abovedisplayshortskip}{\dimexpr\abovedisplayshortskip}
  \setlength{\belowdisplayshortskip}{\dimexpr\belowdisplayshortskip}
}
\usepackage{amsmath}
\begin{document}
1111111111111111111111111111111111111111111111111111111111111111111111
\begin{align}
2 + 2 + \frac{1}{2}
\end{align}
2222222222222222222222222222222222222222222222222222222222222222222222
%\vspace{21.393cm}\\ GG

\newpage
%\showoutput
%\showthe\abovedisplayskip
1111111111111111111111111111111111111111111111111111111111111111111111
\begin{align}
2 + 2 + \frac{1}{2}
\end{align}
2222222222222222222222222222222222222222222222222222222222222222222222
\vspace{21.393cm}\\ GG
\end{document}
Werner
  • 603,163