13

I'm writing a short document of (3-4 pages), and try to condense it into the allowed space.

Putting \looseness=-1 at the end a paragraph helps quite a lot. Is there a way to tell LaTeX to treat every paragraph as if there is a \looseness=-1 at its end, or must I put the command after each and every paragraph by myself?

13

At the end? Rather at the beginning. And generally:

\everypar{\looseness=-1}

However it does not mean that every paragraph will be one line shorter.

| improve this answer | |
  • 1
    Thanks! why at the beginning? I was always putting it at the end. – Ran G. Nov 25 '13 at 19:30
  • @RanG. Just a save way. At the beginning you are sure, which one is the current paragraph. – Przemysław Scherwentke Nov 25 '13 at 19:38
  • 2
    using \everypar in this manner might very well overrule some "desirable" settings established in basic latex and various document classes and packages. for example, check its effect in itemized and enumerated lists. (i haven't tried it, but a quick scan of latex.ltx shows that \everypar is used extensively.) – barbara beeton Nov 25 '13 at 19:50
  • 2
    @PrzemysławScherwentke -- on a very short, text only, document, worth a try. just be aware that there may be side effects. – barbara beeton Nov 25 '13 at 20:00
  • 3
    Slightly safer is \everypar=\expandafter{\the\everypar\loosness=-1 }. One can put it at the end of each paragraph by redefining \par, but LaTeX also uses \par very extensively. Finally, one can simply set \linepenalty=1000 (or larger). This adds a penalty for each line and so TeX tries to reduce the number of lines. It is not reset with each paragraph, so it only needs to be set once. Basic LaTeX does not touch \linepenalty except to set the default value (10). – Dan Nov 26 '13 at 4:54
6

Dan's suggestion in a comment to Przemysław Scherwentke's answer deserves more visibility:

Finally, one can simply set \linepenalty=1000 (or larger). This adds a penalty for each line and so TeX tries to reduce the number of lines. It is not reset with each paragraph, so it only needs to be set once. Basic LaTeX does not touch \linepenalty except to set the default value (10).

| improve this answer | |

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.