5

I have problems with dealing with widows within a multicols environment, that is, I have not managed to instruct LaTeX to remove the them.

This PDF document shows an example of the problem. At the top of the second page, I get a widow from the last paragraph of the first page. I have tried a couple of approaches, without luck:

  • setting both \widowpenalty and \clubpenalty to high values
  • switching between \raggedcolumns and \flushcolumns
  • adjusting the collectmore and unbalance counters

I've also read through the documentation for multicol but have not found anything useful.

Is there anything else I could try?

(The complete LaTeX document for the above example)

Linuxios
  • 34,849
  • 13
  • 91
  • 116
Guðmundur H
  • 11,478
  • 3
  • 24
  • 22

2 Answers2

2
{\obeyspaces\gdef\nomorebreak{\beginnomorebreak\let \nobreakspace}}
\def\beginnomorebreak{\begingroup
   \def\par{\endgraf\endgroup\par\penalty 9999 }\obeyspaces
   \brokenpenalty 10000 \widowpenalty 10000 \clubpenalty 10000 }
\def\nobreakspace{\vadjust{\nobreak} \removespaces}
\def\removespaces{\futurelet\next\checkspace}
\def\checkspace{\ifx\next\nobreakspace\expandafter\removesinglespace\fi}
\def\removesinglespace#1{\removespaces}

Insert \nomorebreak at any place of your paragraph. Page breaks will be prohibited after this macro until the end of the paragraph.

Alexey Malistov
  • 26,407
  • 13
  • 68
  • 88
2

It seems that the TeX FAQ item Controlling widows and orphans has some options you did not try yet.

Getting rid of a widow can be more tricky. Options are

  • If the previous page contains a long paragraph with a short last line, it may be possible to set it “tight”: write \looseness=-1 immediately after the last word of the paragraph.
  • If that doesn’t work, adjusting the page size, using \enlargethispage{\baselineskip} to “add a line” to the page, which may have the effect of getting the whole paragraph on one page.
  • Reducing the size of the page by \enlargethispage{-\baselineskip} may produce a (more-or-less) acceptable “two-line widow”.
0xC0000022L
  • 20,597
  • 9
  • 86
  • 152
AVB
  • 3,994
  • 22
  • 21