1

I use \widowpenalty and \clubpenalty to avoid widow and orphan lines. However, latex automatically increases the line spacing of my document. How do I prevent the increment of line spacing while using these two variables?

  • Welcome! No, it doesn't do that. Not by default. – cfr May 13 '16 at 23:57
  • Thank you for the reply. Is there any way to change this behavior? – user3716774 May 14 '16 at 0:02
  • You mean so that it does do that? I already told you that it does not increase the line spacing. Yes, if you wish to increase the line spacing, you can use setspace to set one-half or double spacing or a custom increase of your choice. – cfr May 14 '16 at 0:09
  • Which document class do you use? Have you tried adding the instruction \raggedbottom to the preamble? – Mico May 14 '16 at 0:12
  • I think it was because I set geometry to 1 in on each side. When I use \newpage to the place where I want to separate the paragraph, everything works fine – user3716774 May 14 '16 at 0:58
6

Changing \widowpenalty and \clubpenalty does not alter the line spacing as the following example shows:

\documentclass{article}
\usepackage{kantlipsum}
\begin{document}
\noindent
\begin{minipage}{.5\textwidth}
  \widowpenalty0
  \clubpenalty0
  \kant[1]
\end{minipage}%
\begin{minipage}{.5\textwidth}
  \widowpenalty10000
  \clubpenalty10000
  \kant[1]
\end{minipage}
\end{document}

line spacing comparison

However, because increasing these penalties makes it harder for LaTeX to find good page breaks, additional spacing must appear somewhere to fill out the pages. Depending on your settings, this might be at the bottom of pages, between sections or paragraphs etc. Basically, the space has to go somewhere in order to ensure that, for example, an additional line or so gets pushed past a page break when needed.

Without an example, it isn't possible to say precisely what is going on in your case or how you might alter it.

But note that the more restrictions you place on LaTeX, the worse the results will be in general so constraining typesetting to exclude widows and orphans will force LaTeX to make worse choices than it otherwise would regarding other aspects of the document, probably including uneven and excessive spacing in some cases.

  • I think it was because I set geometry to 1 in on each side. When I use \newpage to the place where I want to separate the paragraph, everything works fine. When I don't set the bottom margin in geometry, the paragraph go pass the bottom line – user3716774 May 14 '16 at 1:03
  • 1
    That has nothing to do with line spacing. But it does show that you are almost certainly misusing geometry by keeping secrets from it and then being surprised it doesn't know them. If you use geometry, you should not change any page layout dimensions manually. You should change them exclusively with geometry. – cfr May 14 '16 at 1:14
  • geometry has a heightrounded option that can help with added vertical spaces (sort of). It makes the text area an integral multiple of \baselineskip. – TH. May 14 '16 at 15:26

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.