6

I have a KomaScript Project and i have set the following parameters as it is suggested everywhere around the web:

\clubpenalty=10000
\widowpenalty=10000
\displaywidowpenalty=10000
\raggedbottom  % this was my last try, it also doesn't seem to have an effect

Howvever, there are way to may widows in my document, I believe, the commands do not have any effect at all.

Example 1 enter image description here

Example 2 enter image description here

Are there any pitfalls which may cause these commands to not work properly? The documentclass is scrreprt with twoside option disabled.

nozzleman
  • 195
  • A one line paragraph is not a widow, as far as TeX is concerned. Without an example, it's impossible to say more. – egreg Oct 17 '14 at 10:31
  • i have added 2 images for you to see some examples. i hope that helps – nozzleman Oct 17 '14 at 10:34
  • 4
    both those images show two lines being taken over a page not 1 so the penalties have had an effect (or were not needed) – David Carlisle Oct 17 '14 at 10:34
  • i thought those commands would prevent exactly this behaviour? – nozzleman Oct 17 '14 at 10:42
  • 4
    @nozzleman they are a penalty against a single line being affected by a page break, two lines are considered OK (etex has an extension that allows you to specify penalties for multiple lines into the paragraph) – David Carlisle Oct 17 '14 at 10:53
  • alright, thank you very much for that explanation! In this case, my question is nonsense :/ – nozzleman Oct 17 '14 at 10:54
  • 1
    well you could rephrase it to ask how to prevent just two lines being taken over a page (and then I'll look up exactly how \widowpenalties (with an s) is supposed to work:-) – David Carlisle Oct 17 '14 at 10:56
  • If you want to keep more lines together you could try \widowpenalties=3 10000 10000 150. But I wouldn't put such restrictions on the pagebreaking: It will probably bite back somewhere else. – Ulrike Fischer Oct 17 '14 at 10:57
  • @UlrikeFischer possibly make that an answer, we probably don't have many examples of \widowpenalties on site? – David Carlisle Oct 17 '14 at 10:58

1 Answers1

14

You can use \widowpenalties to avoid that two lines are alone on the second page:

\documentclass{article}
\usepackage{lipsum}
\textheight=10\baselineskip
\widowpenalties=3 10000 10000 150
\begin{document}
\lipsum[1-2]
\end{document}
Ulrike Fischer
  • 327,261
  • 1
    Assuming you want the widow penalty to apply only to the lines you've specified you want \widowpenalties=4 10000 10000 150 0 here: the last value is repeated. (Try for example \showthe\widowpenalties4 in your example to see this.) – Joseph Wright Oct 17 '14 at 12:26
  • 1
    It might also be worth noting that the penalties read backward here (first value applies between the last two lines of the paragraph, etc.) – Joseph Wright Oct 17 '14 at 12:27