# Equation at page break forces widow line from previous paragraph

I have a two-column document, and I'm having some weird behavior at an automatic page break. I have some text followed by some equations like this:

So that abutting triangles do not double-paint pixels, a bias of 1 is subtracted from edges that are top'' or left'' \cite{fgiesen}.
\begin{gather}
A=Y_2 - Y_1 \label{eqn:a}\\
B=X_2 - X_1 \label{eqn:b}\\
C=BY_1 - AX_1 \label{eqn:c}
\end{gather}


This paragraph falls at the end of a page, so on the next page, I get a widowed line, followed by the equations:

And then it stretches out the inter-paragraph spacing on the previous page.

If I put a line break between the paragraph and the equation, it does let the paragraph end on the previous page. However, it then puts a huge blank space at the top of the next page where the equations are.

I have tried all sorts of tricks, like messing with the abovedisplayskip (no effect) and negative vspace (no effect until it got negative enough to pull the equations onto the previous page, overlapping the text).

I also did this, but to no effect:

\widowpenalty=10000
\clubpenalty=10000


Can anyone tell me how to get LaTeX to behave sensibly and let the paragraph end on the previous page and also have the equations line up at the top of the next page?

Thanks!

• Someone suggested putting a \goodbreak on the last line of the paragraph before the equations. That just acted like a paragraph break. Lots of whitespace between the equation and the top of the page. Sep 28, 2015 at 23:50
• I added \allowdisplaybreaks[4] to the preamble, and it helped things look a lot better, breaking gathers across pages. It looks better but didn't quite do what I'm asking for. Sep 29, 2015 at 0:05
• starting a page with a display is considered bad form in traditional math publishing. hence, the last line of text is brought over to start the page, and it is (in this situation) not considered a widow. in your particular case, you can easily force the page break between text and display simply by leaving a blank line. but it isn't recommended. and it should only be done in this single case after everything else is final, as it has bad effects on the vertical spacing above and below displays if you do it everywhere. Sep 29, 2015 at 14:10
• I did try the blank line, but it left a huge amount of whitespace above the equations on the beginning of the next page. How do I fix that? Sep 29, 2015 at 17:23
• One solution I found is to put the equations into a float without a caption. There is still excessive whitespace at the top, but less than when I insert a blank line between the paragraph and the equations. On the basis of where I put the float in the latex source, the float ends up in the right place such that it looks the way I want. Personally, I think it's a bug that there's no way to FORCE allowing a column/page break between text and equations and not get this huge amount of extra whitespace. Nov 18, 2015 at 17:36

as i said in a comment, don't do it. if you are submitting this document to a well-edited math journal, it will be reversed.

however, if you must, this should work:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
some text

\vfill
So that abutting triangles do not double-paint pixels, a bias of 1 is subtracted from edges that are top'' or left'' \cite{fgiesen}.

\newpage
\noindent
\begin{minipage}{\textwidth}
\begin{gather}
A=Y_2 - Y_1 \label{eqn:d}\\
B=X_2 - X_1 \label{eqn:e}\\
C=BY_1 - AX_1 \label{eqn:f}
\end{gather}
\end{minipage}
\medskip
<resume text here>
\end{document}


within the minipage, the skip above the display will be suppressed. the skip below will also be suppressed, so you need to compensate for that. the actual value depends on the document class you're using, but \medskip seems to be a reasonable approximation.

Faced the same problem.

From the documentation of package widows-and-orphans: "We also do this for \predisplaypenalty, which controls a break just in front of amath display. This is normally set to 10000 so such breaks don’t happen in standard Latex, but if the value is lowered it becomes possible, and thus a possible issue."
Using \predisplaypenalty=150 solved my problem.
Value 150 seems sensible according to http://www.texfaq.org/FAQ-widows

N.B. There is also \postdisplaypenalty, which controls whether there can be a break after an equation. You may want to lower its value (locally) when you have an equation at the bottom followed by small descriptive sentence.

• Package 'widows-and-orphans' supersedes package 'nowidow'. But you seem to have set it up yourself. Or am I wrong?
– Bart
Sep 8, 2020 at 15:13