From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/83053 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: orphans and widows in poems Date: Mon, 17 Jun 2013 23:21:50 +0200 Message-ID: <51BF7DEE.9030109@wxs.nl> References: <51BD6D5D.4060203@web.de> <3C07CDF2-C407-4DB8-B20A-59DF79791DBA@gmail.com> <51BF4503.5020801@web.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; Format="flowed" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1371504129 9350 80.91.229.3 (17 Jun 2013 21:22:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Jun 2013 21:22:09 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 17 23:22:11 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UogsL-0004oH-67 for gctc-ntg-context-518@m.gmane.org; Mon, 17 Jun 2013 23:22:09 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 70AA4101F6; Mon, 17 Jun 2013 23:22:08 +0200 (CEST) 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 hBCHebz5f8gO; Mon, 17 Jun 2013 23:22:06 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 4ABE5101F1; Mon, 17 Jun 2013 23:22:06 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6F2B7101F1 for ; Mon, 17 Jun 2013 23:22:04 +0200 (CEST) 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 SD5sBlerfzLg for ; Mon, 17 Jun 2013 23:22:03 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id EB2F5101EE for ; Mon, 17 Jun 2013 23:21:52 +0200 (CEST) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r5HLLqee013651 for ; Mon, 17 Jun 2013 23:21:52 +0200 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.104; Original-Received: from [10.100.1.104] (unverified [10.100.1.104]) by pragma-net.nl (SurgeMail 6.3c2) with ESMTP id 8077-1713362 for ; Mon, 17 Jun 2013 23:21:52 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: 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: 0QJNxlQcm - edd6d0e33b65 - 20130617 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 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:83053 Archived-At: On 6/17/2013 11:05 PM, Wolfgang Schuster wrote: > > Am 17.06.2013 um 19:18 schrieb Pablo Rodr=EDguez : > >> On 16/06/13 21:03, Wolfgang Schuster wrote: >>> Am 16.06.2013 um 09:46 schrieb Pablo Rodr=EDguez : >>>> [...] >>>> Is there no way to avoid orphans and widows in the lines >>>> environment? >>> >>> 1. Don=92t use * in your setups names because names starting with an >>> asterisk are system modes. >>> >>> 2. To load the defaults settings you have to use \setups[*reset] >>> which needs the asterisks because it=92s a system mode. >>> >>> 3.The settings doesn=92t help because in the lines environment each >>> line is a separate paragraph which makes \widowpenalty useless here. >> >> Thanks for your reply, Wolfgang. >> >> So, according to 3, there is no way to prevent widow or orphan lines in >> a line environment, isn't it? > > Not with the current implementation of the environment because it doesn= =92t > know how many lines are there. With a Lua based solution it would be simp= le > to add a mechanism to prevent a page break at a certain region because > the needed information are available. yes, some of that is on the agenda (not to hard but as usual it take a = bit of thinking / experimenting to get an interface) basically it's a variant of \setpenalties (the plural \widowpenalties etc) > \startluacode > > userdata =3D userdata or { } > userdata.linescontent =3D userdata.linescontent or { } > > local linescontent =3D userdata.linescontent > > function linescontent.process() > local lines =3D string.splitlines(buffers.getcontent("linescontent")) > context.begingroup() > for i=3D1,#lines do > local l =3D lines[i] > context("%s",l) > context.par() > end > context.endgroup() > end > > \stopluacode > > \def\startlinescontent > {\grabbufferdata[linescontent][startlinescontent][stoplinescontent]} > > \def\stoplinescontent > {\ctxlua{userdata.linescontent.process()}} > > \starttext > > \startlinescontent > One > Two > Three > Four > Five > Six > \stoplinescontent > > \stoptext > > Wolfgang > _________________________________________________________________________= __________ > 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-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ > -- = ----------------------------------------------------------------- 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 t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________