Skip to main content

Widows & orphans

No lone paragraph line at the top or bottom of a page. LuaLaTeX: lua-widow-control lengthens or shortens the paragraph by one line instead of leaving an empty line; pdfLaTeX: nowidow.

% Avoid orphans and widows (a single line of a paragraph left at the bottom or top
% of a page).
\ifdefined\directlua
% LuaLaTeX: lua-widow-control removes them by lengthening or shortening a paragraph
% by one line, instead of leaving an empty line at the bottom of the page.
\usepackage{lua-widow-control}
\else
% pdfLaTeX: nowidow sets \clubpenalty and \widowpenalty; using a package feels less
% hacky than tuning them manually.
\usepackage[all,defaultlines=3]{nowidow}
\fi

% Avoid a widow line being split off a displayed equation.
\displaywidowpenalty=10000