Dealing with widows in a multicol environment
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 approache开发者_JAVA百科s, without luck:
- setting both
\widowpenalty
and\clubpenalty
to high values - switching between
\raggedcolumns
and\flushcolumns
- adjusting the
collectmore
andunbalance
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)
{\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.
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”.
精彩评论