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?

5
  • Welcome! No, it doesn't do that. Not by default.
    – cfr
    Commented May 13, 2016 at 23:57
  • Thank you for the reply. Is there any way to change this behavior? Commented May 14, 2016 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
    Commented May 14, 2016 at 0:09
  • Which document class do you use? Have you tried adding the instruction \raggedbottom to the preamble?
    – Mico
    Commented May 14, 2016 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 Commented May 14, 2016 at 0:58

1 Answer 1

7

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.

3
  • 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 Commented May 14, 2016 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
    Commented May 14, 2016 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.
    Commented May 14, 2016 at 15:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .