When I set my papers, it sometimes happens that the last line of a paragraph is very short, in extreme cases just a single word, perhaps a page number.

I have set \clubpenalty to 10000, of course, and tried to adjust spacing with \looseness=-1. Even so, I sometimes have to resort to \rlap{}, bleeding into the right margin, as it were. (See the line immedaitely below the image in the attached image).

Is there a way to do this automatically, i.e. for a very short line?

enter image description here

  • 9
    Bleeding is typographically much worse than orphaning. In your case, I would suggest you to reword the text so that it's a bit longer and the whole Bedeutung~\cite[...]{...} moves to the next line. Or to reword is so that it's a bit shorter. And btw, do you use \usepackage{microtype}? It might help as well. – yo' Dec 5 '13 at 12:53
  • This is just an example. I could certainly reword, or perhaps use another footnote, but I'm interested in a possible solution to the problem regardless. – Ingmar Dec 5 '13 at 12:54
  • 2
    You can set \parfillskip to 0pt plus some value below \lineskip. This will make sure the last line of the paragraph doesn't get too short. I don't think it will bleed into the margin; using microtype will make sure everything is rearranged approriately. – Stephan Lehmke Dec 5 '13 at 13:04
  • 4
    @Ingmar The issue is that this problem has no general solution. No matter what others claim (MS Word, Patoline, ...), it is impossible to some situations to get a reasonable automated results, and if you're not allowed to reword, some paragraphs will look bad, no matter what you do. – yo' Dec 5 '13 at 13:40
  • BTW, \clubpenalty refers to the first line of a paragraph. I think we mean \widowpenalty here. While there is disagreement on the meaning of "widows" and "orphans", Knuth uses "orphan" to refer to a page break after the first line of a paragraph and "widow" for a break before the last line. – Dan Dec 5 '13 at 22:17

LaTeX is not capable of automated solution for your problem. You can always need to observe the log for bad boxes. You have several options for solutions:

  • re-word the text (preferred solution)

  • try to use {\sloppy Your problematic paragraph.\par} or the sloppypar einvironment (reasonable solution)

  • allow a widow or an orphan (reasonable solution)

  • force an overfull line (bad solution)

What you do is in the end up to you, but you've been warned.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.