![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 11/20/2013 10:47 PM, Lars Huttar wrote:
Hello,
On this list I've been advised that mixedcolumns is the latest and greatest implementation of columns; the one to use. We have switched over from columnsets to mixedcolumns, and have been very pleased with the column balancing (for some reason we couldn't get column balancing to work in columnsets).
However one thing we do miss from columnsets is the control over widows & orphans in two ways: \testcolumn, and \setupcolumnsetlines. \testcolumn[n] allowed us to do a conditional column break, so when we were about to start a new subsection heading, we could prevent it being an orphan at the bottom of the column; and when starting a paragraph with a hangaround graphic framed flushright and bottom, we could similarly use \testcolumn to prevent the graphic from hanging down into the footer (which is what sometimes happened otherwise).
So I'm wondering, is there some way to achieve the equivalent of \testcolumn in mixedcolumns?
Is it theoretically impossible to implement this in mixedcolumns because the required information (how many lines are left in the current column) is not yet known? Or could that information be gleaned from somewhere?
I see in page-brk.mkiv the following definition for \testcolumn:
\def\testcolumn {\dodoubleempty\page_tests_columns_test}
\def\page_tests_columns_test[#1][#2]% {\endgraf \ifdim\pagegoal<\maxdimen \ifdim\pagetotal<\pagegoal \d_page_tests_test\dimexpr \pagegoal -\pagetotal \ifdim\lastskip<\parskip+\parskip\fi \ifsecondargument+#2\fi \relax \getrawnoflines\d_page_tests_test % (raw) \ifnum#1>\noflines \column \fi \else \penalty-\plustenthousand % (untested) \fi \fi}
I'm not a low-level TeX programmer, and I don't understand a lot of this, but it looks like \getrawnoflines\d_page_tests_test puts the number of remaining lines into \noflines
Any suggestions are appreciated. (And I should have a MWE soon.)
That macro was never meant for mixed columns. I made a variant that works ok in mixed columns which will be in the next beta. \setuptolerance[verytolerant] \starttext \startmixedcolumns \dorecurse{4}{\input ward \par} \testcolumn[10][-1pt] % 10 lines - 1pt slack \dorecurse{2}{\input ward \par} \stopmixedcolumns \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------