[Tex/LaTex] automatically to apply \enlargethispage{\baselineskip} when single-word-widow occurs

automationpage-breakingwidows-orphans

Sometimes I encounter this single word widows instance very often, please find the right hand page, topline scoundrel. My design strategy is to leave enough white space at the bottom margin, so when it does happen, the code \enlargethispage{\baselineskip} will apply to the left hand page to enable the scoundrel slot back to place.

Of course, controversially, one can apply it manually through out all the instances, I wondered if there is an automatic way of doing this?

I am using the document class of—Book "COMA-SCRIPT"

ps. I also applied \pretolerance=5000 \tolerance=1000 in the Preamble, not sure what they do, was told it can prevent instances of widows and orphans…

widows example

Best Answer

Without an example it is hard to say but if you add

\widowpenalty=10000

Then TeX will try as hard as it can to avoid widows. The tolerance settings probably are not doing very much in your case as with such short paragraphs there is very little flexibility in line breaking anyway.

If there is any vertical stretch in your page (as in the default parskip spacing in standard classes) then probably preventing widows will pull the last couple of lines over to the next page. If there is no vertical stretch then you will get an underfull page on the previous page, in which case you could potentially detect that in the output routine and put the text back after enlarging the page but such interactions are very delicate and depend greatly on the content you have as it's very hard to make things work in general.

Related Question