2

I often find I get page widows before equations, due to (it seems) the paragraph text being stuck to the equation. How can I allow pagebreaks just before equations?

My current solution is to insert \par manually, but this results in extra space above the equation if the pagebreak moves.

I suppose I'm open to being convinced that this is bad typography, but I really don't mind it myself.

MWE

\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1-5]
% \par % working solution, results in extra space unless exactly at pagebreak
\begin{equation}
x = 1
\end{equation}
\lipsum[6]
\end{document}

Result

Undesired widow: widow Undesired extra space: extra space

2
  • Looking through my old engineering textbooks, it seems like publishers (incl. Wiley, McGraw-Hill, and Addison Wesley) just live with the widows.
    – dedded
    Commented Mar 11, 2022 at 19:52
  • LaTeX goes to great effort to avoid precisely what you want to do. Nor is putting equations in their own paragraphs advised. Are you sure this is a good idea? Commented Mar 12, 2022 at 3:23

1 Answer 1

2

You do not say what you want to happen instead of the widow line.

You can prevent it absolutely

\documentclass{article}
\usepackage{lipsum}

\displaywidowpenalty=10000

\begin{document}
\lipsum[1-5]
% \par % working solution, results in extra space unless exactly at pagebreak
\begin{equation}
x = 1
\end{equation}
\lipsum[6]
\end{document}

But that is not usually recommeded, but here even a penalty of 9999 is not enough to prevent the break leaving one line as there is so little flexibility on the previous page, just 1pt possible strech at each paragraph break so only 3pt of flexible glue which is not enough to save one line of text. So ideally if you want to prevent widows you need to add more flexible glue somewhere or re-write the text to avoid the problem when it occurs.

If you add widows-and-orphans

\documentclass{article}
\usepackage{lipsum}

\usepackage{widows-and-orphans}

\begin{document}
\lipsum[1-5]
% \par % working solution, results in extra space unless exactly at pagebreak
\begin{equation}
x = 1
\end{equation}
\lipsum[6]
\end{document}

tex warns you about the widow:

Package widows-and-orphans Warning: Display widow on page 2

so you could take manual correction forcing the page break earlier or later:

enter image description here

\documentclass{article}
\usepackage{lipsum}

\usepackage{widows-and-orphans}

\begin{document}
\lipsum[1-5]
\clearpage
\begin{equation}
x = 1
\end{equation}
\lipsum[6]
\end{document}

or

enter image description here

\documentclass{article}
\usepackage{lipsum}

\usepackage{widows-and-orphans}

\begin{document}
\enlargethispage{\baselineskip}
\lipsum[1-5]
\begin{equation}
x = 1
\end{equation}
\lipsum[6]
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .