[Tex/LaTex] Widow word on a page? I thought LaTeX wouldn’t do that

page-breakingwidows-orphans

Just had a surprise. I have a section in an article followed by a figure. The text flows over a page and … one more word on the next page (which also includes the figure).

Yes, I added a ~ before that word to make it fit on the first page but I thought LaTeX wouldn't do this (leave widow words, not even sentences)!

Is there anything in particular that needs to be enabled to avoid this? I used MikTeX 2.8 with output to PDF (both pdftex and pdflatex produced the same problem).

Best Answer

LaTeX is set up to avoid this if possible but sometimes there just isn't a good alternative. You can suppress widow lines entirely with \widowpenalty=10000 but you'll want to have \raggedbottom enabled.

Avoiding widow words isn't as directly straightforward. You cannot automatically suppress them but you can specify that you want a final line of at least some certain length with

\parfillskip 0pt plus 0.75\textwidth

where "some certain length" is, in this case, one quarter of the text width of the document.