From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/85354 Path: news.gmane.org!not-for-mail From: Lars Huttar Newsgroups: gmane.comp.tex.context Subject: a way to implement \testcolumn in mixedcolumns Date: Wed, 20 Nov 2013 16:47:58 -0500 Message-ID: <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" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1384984093 22497 80.91.229.3 (20 Nov 2013 21:48:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Nov 2013 21:48:13 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Nov 20 22:48:16 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 1VjFdA-0001Ss-Fa for gctc-ntg-context-518@m.gmane.org; Wed, 20 Nov 2013 22:48:16 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7F7C4101FF; Wed, 20 Nov 2013 22:48:15 +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 btMw-A5yjc5k; Wed, 20 Nov 2013 22:48:12 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 6E1B9101EA; Wed, 20 Nov 2013 22:48:12 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DF958101EA for ; Wed, 20 Nov 2013 22:48:08 +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 2V0jpa6IauSo for ; Wed, 20 Nov 2013 22:48:04 +0100 (CET) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id 5865F101E5 for ; Wed, 20 Nov 2013 22:48:04 +0100 (CET) Original-Received: from mail-yh0-f53.google.com (mail-yh0-f53.google.com [209.85.213.53]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id rAKLm0K9017229 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 20 Nov 2013 22:48:03 +0100 Original-Received: by mail-yh0-f53.google.com with SMTP id b20so4025405yha.12 for ; Wed, 20 Nov 2013 13:48:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=xMglUwYhycBVlGEjN7hetgZ7ZnID+05ALJ7adZ/0l6Y=; b=PUkjupRGQngYwDAVYPckjZ1wojrNjPfQfWSB51K3yr1lG7GN+U+Av9r90aUi/YPEpa MkLyRFJK/GoylIM8r3GeFF6oi542l+8t3ShnW7LbrsR/gx44iL7vL7pmyfood3Ri1EqI 48dV7IS1KwVNM+zSUItcyG5fFrBV/q2PRvx3tM6WHgkU6opMv01iRqyp7JxM7p0Vvtb/ 9DlITe1sdZVUz02JMqdtFkCX7lQQH7uH9kfB89hn0O241oD8s+pRGaKYO0GFIjD+r1EO LCElPe9IIoC7YU+f85rB8mwQARpsughM/6BVHzSqCul80okVt3Mqo5CpLqTB2WTxh/Qq F1cw== X-Gm-Message-State: ALoCoQnHPLvZJw9crCglTp7/S1pdzgwh9ECiOBWhSYbwk5U4Z0SoJAWLXM8chgdy9cGieEeWG7Zx X-Received: by 10.236.106.6 with SMTP id l6mr2453580yhg.17.1384984080334; Wed, 20 Nov 2013 13:48:00 -0800 (PST) Original-Received: from [172.22.10.212] ([162.40.29.3]) by mx.google.com with ESMTPSA id m29sm43412511yho.14.2013.11.20.13.47.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Nov 2013 13:47:59 -0800 (PST) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.213.53; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07KPVM1zw - 357e86f87f9f - 20131120 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) 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:85354 Archived-At: 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.) Lars ___________________________________________________________________________________ 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 ___________________________________________________________________________________