From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/83052 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: orphans and widows in poems Date: Mon, 17 Jun 2013 23:05:59 +0200 Message-ID: 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 (Mac OS X Mail 6.5 \(1508\)) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1371503175 30344 80.91.229.3 (17 Jun 2013 21:06:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Jun 2013 21:06:15 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 17 23:06:17 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 1Uogcx-0008RZ-UZ for gctc-ntg-context-518@m.gmane.org; Mon, 17 Jun 2013 23:06:16 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0B899101F6; Mon, 17 Jun 2013 23:06:15 +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 avA1-UbV9cs8; Mon, 17 Jun 2013 23:06:13 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 3C5EF101F1; Mon, 17 Jun 2013 23:06:13 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 693C4101F1 for ; Mon, 17 Jun 2013 23:06:11 +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 amN+8nDMmpjR for ; Mon, 17 Jun 2013 23:06:10 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 7D79A101EE for ; Mon, 17 Jun 2013 23:06:00 +0200 (CEST) Original-Received: from mail-ee0-x230.google.com (mail-ee0-x230.google.com [IPv6:2a00:1450:4013:c00::230]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r5HL5xAj028973 for ; Mon, 17 Jun 2013 23:06:00 +0200 Original-Received: by mail-ee0-f48.google.com with SMTP id b47so2082887eek.35 for ; Mon, 17 Jun 2013 14:05:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=JOzZK10C8o1iCl5wjLkc44fTYQtavKqSPhurI+BxCHA=; b=EPovJwmmpeSLtc+8tYi41W9tBx1stU7RR/dCkfbfza68WUQFYoM/THzhUHJKjmSKZj o0HUwTGFnAgnAqXb9US0Pyxque6v+kZJ/b6Q+2Rq0k6v/CYJ5l3fTXgS5ulDAuoUt2mQ kuBJXOS5AFQTXfN8Zm9xrwdTKq153BPdnhQUvDD5s7cT11eLxsAu9SMoTgSY5a4j5gJd QGirWk7TdAq2SLezmC7cUmwCuBaOXhEbDN2270HzxiY51uBZitYJzUKswwxEs/g0kgcX s36E9NSxPjl30jI461wQzLQpR3nn2SKiJZnw7FAlzvgJ8Qd0L8HVbMClTN7YWHMl4RJm 3nfw== X-Received: by 10.14.203.194 with SMTP id f42mr19062079eeo.53.1371503159893; Mon, 17 Jun 2013 14:05:59 -0700 (PDT) Original-Received: from keima.localdomain (nrbg-4dbfb4b8.pool.mediaWays.net. [77.191.180.184]) by mx.google.com with ESMTPSA id b7sm25954372eef.16.2013.06.17.14.05.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 14:05:59 -0700 (PDT) In-Reply-To: <51BF4503.5020801@web.de> X-Mailer: Apple Mail (2.1508) X-Bayes-Prob: 0.0003 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:4013:c00::230; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01JNx60Go - ecace972a60e - 20130617 (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:83052 Archived-At: 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 simple to add a mechanism to prevent a page break at a certain region because the needed information are available. \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 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 ___________________________________________________________________________= ________