I have a relatively simple question. I'm compiling a large document and finding that I have a lot of pages that start with the last two lines of a paragraph. Is there a way to allow the line-spacing to vary to avoid this? It's currently set to \onehalfspacing using the setspace package.

Update following David's answer: Is there a way to allow a general spacing feature to vary for the same purpose?

The two-liners are mostly caused by \widowpenalty=10000 and \clubpenalty=10000 to avoid widows and orphans. I was hoping that the penalties would squeeze text onto one page rather than expanding it to more on the next page.

I've been searching the site for an answer to this but I haven't manage to find one even though I imagine a solution, if one exists, has been described somewhere else. Other than, of course, just rewriting a few sentences...

  • To avoid the two-liners maybe you could try to enlarge \interlinepenalty a bit to encourage breaking after the paragraph. Furthermore, you could use \widowpenalties to make it especially (but decreasingly) undesirable to split off two, three and so on lines. Apr 11 '12 at 9:39

You really don't want to do this;-)




\baselineskip=1\baselineskip plus 12pt minus 2pt\relax




If you remove the plus component and only have the minus component then TeX will only squeeze and never shrink. But worrying about widow and club lines is typographic fine tuning and if you have variable line spacing really it's a typographic disaster area already so widow and club lines would not be a concern in that case (only half a :-) ).

Is there no other white space on the pages that you can make stretchable?: inter paragraph space, space after headings or around lists or anywhere? Interline space would only be my very last resort. Actually after last resort, as I would rather the page was a line bigger or shorter (using \enlargethispage) to help bad breaks.

  • I gather that the warning is because the text on some pages is expanded (to nearly double-spacing) to have paragraph breaks on page breaks? Is there a way to encourage TeX to rather squeeze the line-spacing rather than spreading it? (Or should I just bite the bullet and rewrite those few sentences?)
    – Warrick
    Apr 11 '12 at 7:47
  • reply was too long for a comment so I'll put it in the edited answer Apr 11 '12 at 8:25
  • Is the method above extensible to other spacings? The most frequent and least disruptive breaks in my document are probably those between equations and text. Shall I change my question to ask how to make any appropriate spacing adjustable? That'll give it wider scope.
    – Warrick
    Apr 11 '12 at 8:57
  • That would be much better. display spaces are already stretch by default eg 10pt article class sets \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ \belowdisplayskip \abovedisplayskip but you could make it stretchier paragraph skip is similarly a bit stretchy (just 1pt) but you could increase it in article class \setlength\parskip{0\p@ \@plus \p@} Apr 11 '12 at 9:02
  • 1
    The bits of code I posted in the comment above are from article class showing the defaults so taking abovedisplayskip it is\abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ by default at \normalsize so \abovedisplayskip =10pt plus2pt minus5pt so after begin{document} you could go \abovedisplayskip =10pt plus20pt minus5pt to make it allow to stretch an extra 20pt instead of 2pt, beware that this gets reset on a size change so you have to set it after befindocument or redefine \normalsize, look down book.cls and size10.clo for similar commands Apr 11 '12 at 16:35

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.