Occasionally document overflows into the next page by few words or line. Though this can be adjusted manually by changing a font size or spacing, can it be automatically done? By automatic, I mean if document is overflowing by say 10 words (manually set limit), the font and spacing should automatically be adjusted to save a page without squeezing paper unnecessarily as it happens with the savetrees package.

  • 1
    Does not exactly answer your question, but does this help?
    – Masroor
    Dec 28 '13 at 11:54
  • It may be sufficient to set an infinite penalty to having a number of lines overflow to the following page. Something similar was done in How to prevent page break in the last three lines of an environment?
    – Werner
    Mar 28 '14 at 16:23
  • 1
    You should never change font size nor margins in such an inconsistent way. And while TeX might be (with a lot of problems to arise) capable of detecting that the last page is quite empty, but it's not capable of adjusting a page that has already been shipped.
    – yo'
    Mar 28 '14 at 16:33

Usually, you can use \baselineskip and its little brothers to squeeze things. It would be helpful if we knew where the stretch comes or where you can save some lines. LaTeX is sweet at automating most things that come to typesetting, but sometimes you'll just have to exercise some judgment as to what to squeeze and stretch ;) Sorry if that's not a great answer, but my experience with TeX is that sometimes one has to do the legwork.

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.