From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/85514 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: a way to implement \testcolumn in mixedcolumns Date: Thu, 28 Nov 2013 19:34:34 +0100 Message-ID: <52978CBA.3030109@wxs.nl> References: <528D2E0E.5020804@sil.org> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1385663684 21434 80.91.229.3 (28 Nov 2013 18:34:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Nov 2013 18:34:44 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Nov 28 19:34:50 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vm6QK-0001zX-7K for gctc-ntg-context-518@m.gmane.org; Thu, 28 Nov 2013 19:34:48 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 74A44101FD; Thu, 28 Nov 2013 19:34:47 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id mFJO7Vymw6l7; Thu, 28 Nov 2013 19:34:45 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id BB36F101F5; Thu, 28 Nov 2013 19:34:45 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 30091101F5 for ; Thu, 28 Nov 2013 19:34:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Vtq5EzNMmFMi for ; Thu, 28 Nov 2013 19:34:44 +0100 (CET) Original-Received: from filter3-utr.mf.surf.net (filter3-utr.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id 271B2101F1 for ; Thu, 28 Nov 2013 19:34:44 +0100 (CET) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter3-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id rASIYgcJ015903 for ; Thu, 28 Nov 2013 19:34:43 +0100 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.103; Original-Received: from [10.100.1.103] (unverified [10.100.1.103]) by pragma-net.nl (SurgeMail 6.3c2) with ESMTP id 1945-1713362 for ; Thu, 28 Nov 2013 19:34:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 In-Reply-To: <528D2E0E.5020804@sil.org> X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=15; city=Zwolle; latitude=52.5058; longitude=6.0858; http://maps.google.com/maps?q=52.5058,6.0858&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08KT6yHr2 - 70250702ab2a - 20131128 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:85514 Archived-At: 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 ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________