From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/86229 Path: news.gmane.org!not-for-mail From: "Jan Tosovsky" Newsgroups: gmane.comp.tex.context Subject: Re: Divider in grid environment Date: Sat, 8 Feb 2014 17:32:37 +0100 Message-ID: <13752.6827319109$1391877183@news.gmane.org> References: <007401cf24c9$29d030d0$7d709270$@tosovsky@email.cz> 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 1391877170 23641 80.91.229.3 (8 Feb 2014 16:32:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Feb 2014 16:32:50 +0000 (UTC) To: "'mailing list for ConTeXt users'" Original-X-From: ntg-context-bounces@ntg.nl Sat Feb 08 17:32:56 2014 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 1WCApr-0001SP-Ex for gctc-ntg-context-518@m.gmane.org; Sat, 08 Feb 2014 17:32:55 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A9955101F9; Sat, 8 Feb 2014 17:32:54 +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 kGAgO1fqG6rn; Sat, 8 Feb 2014 17:32:51 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 7ECE5101F2; Sat, 8 Feb 2014 17:32:51 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 13FF4101F2 for ; Sat, 8 Feb 2014 17:32:50 +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 NownoEIPqJkO for ; Sat, 8 Feb 2014 17:32:48 +0100 (CET) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 5F19C101E1 for ; Sat, 8 Feb 2014 17:32:38 +0100 (CET) Original-Received: from fep20.mx.upcmail.net (fep20.mx.upcmail.net [62.179.121.40]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s18GWbat028578 for ; Sat, 8 Feb 2014 17:32:37 +0100 Original-Received: from edge03.upcmail.net ([192.168.13.238]) by viefep20-int.chello.at (InterMail vM.8.01.05.13 201-2260-151-135-20130320) with ESMTP id <20140208163236.TOIX10895.viefep20-int.chello.at@edge03.upcmail.net> for ; Sat, 8 Feb 2014 17:32:36 +0100 Original-Received: from emk ([78.102.140.160]) by edge03.upcmail.net with edge id PsYc1n01S3Tq9wW03sYcyD; Sat, 08 Feb 2014 17:32:36 +0100 X-SourceIP: 78.102.140.160 In-Reply-To: <007401cf24c9$29d030d0$7d709270$@tosovsky@email.cz> X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac8kxxjXuwtD/MCVSXyPbxGWCd4K5wAIhtJQ Content-Language: cs X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=62.179.121.40; country=AT; latitude=47.3333; longitude=13.3333; http://maps.google.com/maps?q=47.3333,13.3333&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06LnQwBMB - 801ad1cdfdf5 - 20140208 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 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:86229 Archived-At: On 2014-02-08 Jan Tosovsky wrote: > I'd like to use a divider between certain paragraphs. As I want to keep > all the lines on the grid so it should have a height = N x line height. > > As \hl renders the line on baseline, I have to tweak the space > before/after using the 'blank' command to keep the horizontal line > in the +/- middle: > > \setuplayout[grid=yes] > \showgrid > \showlayoutcomponents > > \starttext > \input{ward} > \blank[4mm]\middlealigned{\hl[4]}\blank[6mm] > \input{ward} > \stoptext > > But this solution requires adjustments for different fonts or font > sizes... > > Is there a more efficient way how to accomplish this? Additionally, I'd like to keep that divider with the previous content (paragraph). In this case AFAIK \testpage[n] cannot be used directly in the divider definition as it breaks the page at position of this command. I'd like to express rather: If there is no space for three lines, break the page, but grab few previous lines (at least 2) together with me (according to orphan/widow settings). The current behaviour can be demonstrated using this example: \startsetups[grid][mypenalties] \setdefaultpenalties \setpenalties\widowpenalties{2}{10000} \setpenalties\clubpenalties {2}{10000} \stopsetups \setuplayout[grid=yes, setups=mypenalties] \showgrid \showlayoutcomponents \starttext \blank[force, 30*line] \input{tufte} \blank[4mm]\middlealigned{\hl[4]}\blank[6mm] \stoptext In my case the divider is used also to emphasise Chapter ends - so it is very often the last element one the page and there is no need to check also the space which follows (whether next lines will fit or not). So 'keep-with-previous' is enough for me. Jan ___________________________________________________________________________________ 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 ___________________________________________________________________________________