views:

68

answers:

2

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)

A: 
{\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
Thanks Alexey - will try this out.
Guðmundur H
This did the trick - thanks again.
Guðmundur H
A: 

It seems that http://www.tex.ac.uk/cgi-bin/texfaq2html?label=widows has some options you did not try yet.

AVB