Is there a way to tell TeX to avoid breaking the page after the first word of a sentence?
…
…
He was quite dead. Apparently his neck had been
broken. The lightning flashed for a third time, and
his face leaped upon me. I sprang to my feet. It
(text continues on next page)
And then you have to turn the page for the rest of the sentence. It's not in a line on it's own so it can't be penalized like an orphan line.
Can TeX be told, to resolve these by, say, breaking the page before that first word?
Note:
Although the answers given below are very informative, the general consensus had been that the best practice is to leave this for the proofreaders to spot, and then fix manually.
Best Answer
EDIT: I forgot to mention that although this whole answer works in simple cases, it is a bad idea to rely on it for anything serious, since it can break in many different ways. Typically, catcode changes are a bad idea...
EDIT: Lev Bishop pointed out that inserting
\nopagebreak
after each first word of a sentence is too much, because it will forbid line breaks after each line containing the first word of a sentence. Here, I fixed this problem by using the auxiliary file, and checking the page number on both sides of the space following the first word of the sentence.It is also possible to make
.
,!
,?
active, let them read the next word and place\nopagebreak
after the first word of each sentence (except the first one of a paragraph).Thing are more complicated if we still want to use
.
in dimensions (e.g.,width=3.4cm
in\includegraphics
). Also, the last punctuation of a paragraph needs special treatment (in particular when the paragraph does not quite finish with that punctuation (e.g. quotes)...).Hopefully, the code below works. Currently, I've inserted
*
after\nopagebreak
, just to visualize the places where a\nopagebreak
is inserted. Of course, remove it.