From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/87702 Path: news.gmane.org!not-for-mail From: Rik Kabel Newsgroups: gmane.comp.tex.context Subject: Re: Margin heading problem, was Re: sections Date: Thu, 05 Jun 2014 17:41:50 -0400 Message-ID: <5390E41E.2020703@rik.users.panix.com> References: <538BD6F3.1030907@rik.users.panix.com> <538C3148.1020509@wxs.nl> <538D05B6.5070907@rik.users.panix.com> 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 1402004537 19787 80.91.229.3 (5 Jun 2014 21:42:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Jun 2014 21:42:17 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Jun 05 23:42:12 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 1WsfQK-0003cM-Of for gctc-ntg-context-518@m.gmane.org; Thu, 05 Jun 2014 23:42:12 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 58B5610233 for ; Thu, 5 Jun 2014 23:42:12 +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 OPnrBVHuq+dA for ; Thu, 5 Jun 2014 23:42:12 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 3BA1E10213 for ; Thu, 5 Jun 2014 23:42:09 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7EB79101EA for ; Thu, 5 Jun 2014 23:42:03 +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 NXeJ5hyj5p8O for ; Thu, 5 Jun 2014 23:42:02 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 19044101E3 for ; Thu, 5 Jun 2014 23:41:56 +0200 (CEST) Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s55Lfr3K008502 for ; Thu, 5 Jun 2014 23:41:54 +0200 Original-Received: from [192.168.201.179] (cpe-67-240-55-150.nycap.res.rr.com [67.240.55.150]) by mailbackend.panix.com (Postfix) with ESMTP id C1FE335B81 for ; Thu, 5 Jun 2014 17:41:52 -0400 (EDT) User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: <538D05B6.5070907@rik.users.panix.com> X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=166.84.1.89; country=US; region=New York; city=Richmond Hill; latitude=40.7005; longitude=-73.8345; http://maps.google.com/maps?q=40.7005,-73.8345&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0RMaJFRPT - 575ba1f46e0c - 20140605 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 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:87702 Archived-At: On 2014-06-02 19:16, Rik Kabel wrote: > On 2014-06-02 04:09, Hans Hagen wrote: >> On 6/2/2014 3:44 AM, Rik Kabel wrote: >>> On 2014-06-01 12:52, Hans Hagen wrote: >>>> On 6/1/2014 5:40 PM, Rik wrote: >>>> >>>>> Is this also the cause of problems I noted with heading placed into >>>>> the >>>>> margin, as in the example below? >>>> >>>> no, unrelated, try this: >>>> >>>> \setuphead >>>> [section] >>>> [after=3D{\strut\blank[-2*line,samepage,disable]}, >>>> command=3D\SectionCommand, >>>> distance=3D0pt] >>>> >>>> \define[2]\SectionCommand{\inleft{XXXXXX}} >>> >>> That was fine until it ran into \setupwhitespace with a non-zero value. >>> Fiddling with the after key \blank does not appear to help. >>> >>> \define[2]\MarginHead{\inmargin{#1\\#2}} >>> \setuphead [section] >>> [command=3D\MarginHead, >>> distance=3D0pt, >>> after=3D{\strut\blank[-2*line,samepage,disable]}] >>> %% With no \setupwhitespace, or any \setupwhitespace setting that >>> %% results in zero interparagraph whitespace, all is well. >>> %setupwhitespace [none]% okay >>> %setupwhitespace [fix]% okay >>> %% With non-zero interparagraph whitespace, the heading separates >>> %% from the text >>> \setupwhitespace [line]% bad >>> \starttext >>> \startchapter[title=3D{Weisman}] >>> \input weisman\par >>> \input weisman >>> \startsection[title=3D{Thuan}] >>> \input thuan\par >>> \input thuan >>> \stopsection >>> \stopchapter >>> \stoptext >> >> you can always skip back whitespace or add 'nowhite' > > Well, nowhite is a start, but the solution is still a way off. > Meanwhile, the following works for non-grid layouts with reasonable > values for \setupwhitespace, although perhaps somebody can come up with > a more eloquent way to write it: > > \newdimen\SectionHeadSkip > \SectionHeadSkip\dimexpr-2\lineheight-\parskip\relax > \setuphead > [section] > [command=3D\SectionCommand, > distance=3D0pt, > after=3D{\strut\blank[\the\SectionHeadSkip,samepage,disable,nowhi= te]}, > ] > \define[2]\SectionCommand > {\inmargin{#1 =96 #2}} > A better formulation (better because it preserves any stretch that might = defined by \setupwhitespace): \setupwhitespace [big] \newdimen\Parskip \Parskip\dimexpr-\parskip\relax \setuphead [section] [command=3D\SectionCommand, distance=3D0pt, after=3D{\strut\blank[\the\Parskip,-2*line, samepage,disable,nowhite]}, ] \define[2]\SectionCommand {\inmargin{#1 =96 #2}} As with the previous, \Parskip has to be redefined if \setupwhitespace = changes, so it is probably best left until after \starttext, when the = body font is established. > When enabling grid layouts, the number of lines needs to be adjusted. No, it is not stable on grid layouts. Sections that have a figure placed = as the first thing will be a line off. > > Floats that appear as the first thing after a heading may present > problems, especially with larger values for \setupwhitespace. (The > default, with no location=3D specified, is pretty good, but when > location=3D{left,force} or such, there is often an unwanted offset from > the header. and page breaks still appear between the heading and figure > at times, despite the samepage setting for \blank.) > > So, this is quite fragile. It requires careful checking of every > heading, and manual tuning when one breaks. Not a desirable solution, > but at least it is possible. Still fragile. -- = Rik Kabel ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________