From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/57153 Path: news.gmane.org!not-for-mail From: Steffen Wolfrum Newsgroups: gmane.comp.tex.context Subject: Re: blank line and signals Date: Tue, 16 Mar 2010 10:59:29 +0100 Message-ID: References: <496BC989-3F1C-42F8-9CB9-D10A612E6D9E@uni-koblenz.de> <4B9ED1A5.8050809@googlemail.com> <3BF648E0-01A3-4698-BA32-471446789F47@uni-koblenz.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1268733741 28588 80.91.229.12 (16 Mar 2010 10:02:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 16 Mar 2010 10:02:21 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Mar 16 11:02:17 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NrTbM-0007dc-CG for gctc-ntg-context-518@m.gmane.org; Tue, 16 Mar 2010 11:02:16 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E0131C9CE9; Tue, 16 Mar 2010 11:02: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 BPqGap5bIZdk; Tue, 16 Mar 2010 11:02:10 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9E902C9BB5; Tue, 16 Mar 2010 11:00:40 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DCF45C9CDD for ; Tue, 16 Mar 2010 11:00:23 +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 3L6a6Qm6nFUu for ; Tue, 16 Mar 2010 11:00:13 +0100 (CET) Original-Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.31.39]) by balder.ntg.nl (Postfix) with ESMTP id 06DCBC9C07 for ; Tue, 16 Mar 2010 10:59:31 +0100 (CET) Original-Received: from [89.247.56.83] (helo=[192.168.1.4]) by smtprelay01.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1NrTYh-0004VG-7H for ntg-context@ntg.nl; Tue, 16 Mar 2010 10:59:31 +0100 In-Reply-To: <3BF648E0-01A3-4698-BA32-471446789F47@uni-koblenz.de> X-Mailer: Apple Mail (2.1077) X-Df-Sender: 698580 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:57153 Archived-At: Am 16.03.2010 um 10:32 schrieb Andreas Harder: > = > Am 16.03.2010 um 01:32 schrieb Wolfgang Schuster: > = >> Am 14.03.10 15:07, schrieb Andreas Harder: >>> If one removes the blank line after \section{Section} the output is cor= rect, otherwise \TestSpace is ignored =85 >>> = >> \def\DefineSectionBlank >> {\dotripleempty\doDefineSectionBlank} >> = >> \def\doDefineSectionBlank[#1][#2][#3]#4% >> {\edef\CurrentSection{#1}% >> \setvalue{#1:#2:\ifthirdargument\the\dimexpr#3\relax\fi}{#4}} >> = >> \def\SectionBlank#1#2% >> {\edef\CurrentSection{#1}% >> \executeifdefined{#1:#2:\LastSectionBlankSignal}{\executeifdefined{#1:#= 2:\the\dimexpr\zeropoint\relax}{\getvalue{#1:#2:}}}% >> \doif{#2}{after}{\SectionBlankSignal}} >> = >> \let\LastSectionBlankSignal\zeropoint >> = >> \EveryPar{\let\LastSectionBlankSignal\zeropoint} >> = >> \def\SectionBlankSignal >> {\setevalue{LastSectionBlankSignal}{\the\dimexpr\csname\CurrentSection S= ignal\endcsname\relax}} >> = >> % chapter >> = >> \DefineSectionBlank [Chapter] [before] {\blank[force,48pt]} >> \DefineSectionBlank [Chapter] [after] {\blank[20pt]} >> = >> \newsignal\ChapterSignal >> = >> \setuphead >> [chapter] >> [before=3D\SectionBlank{Chapter}{before}, >> after=3D\SectionBlank{Chapter}{after}] >> = >> % section >> = >> \newsignal\SectionSignal >> = >> \DefineSectionBlank [Section] [before] [\ChapterSignal] {\blank[18pt]} >> \DefineSectionBlank [Section] [before] {\blank[24pt]} >> \DefineSectionBlank [Section] [after] {\blank[18pt]} >> = >> \setuphead >> [section] >> [before=3D\SectionBlank{Section}{before}, >> after=3D\SectionBlank{Section}{after}] >> = >> \showgrid >> = >> \starttext >> = >> \chapter{Chapter} >> = >> \section{Section} >> = >> \chapter{Chapter}\edef\CurrentSection{Section}\SectionBlankSignal % tell= \section the last header was \section too! >> = >> \section{Section} >> = >> \chapter{Chapter} >> = >> text >> = >> \section{Section} >> = >> \stoptext > = > Hello Wolfgang, > = > thank you for your elaborate example! > = > In the meantime I played a little with weak/strong blanks, before I figur= ed out that this already works out of the box. It seams that the blank befo= re a head gets a higher priority and overrides the blank after the previous= head, so that there is no need for signals at all =85? In some projects it might look better if the space between two consecutive = section heads is smaller than the regular space between section head and te= xt. That's where signals are needed and where Wolfgang's code does a great job. Steffen ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________