From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/57151 Path: news.gmane.org!not-for-mail From: Andreas Harder Newsgroups: gmane.comp.tex.context Subject: Re: blank line and signals Date: Tue, 16 Mar 2010 10:32:08 +0100 Message-ID: <3BF648E0-01A3-4698-BA32-471446789F47@uni-koblenz.de> References: <496BC989-3F1C-42F8-9CB9-D10A612E6D9E@uni-koblenz.de> <4B9ED1A5.8050809@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: multipart/mixed; boundary=Apple-Mail-3-514435659 X-Trace: dough.gmane.org 1268731971 22482 80.91.229.12 (16 Mar 2010 09:32:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 16 Mar 2010 09:32:51 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Mar 16 10:32:47 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 1NrT8p-0005LL-Fn for gctc-ntg-context-518@m.gmane.org; Tue, 16 Mar 2010 10:32:47 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 43726C9CDD; Tue, 16 Mar 2010 10:32:43 +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 Q0TsAr6KSXk9; Tue, 16 Mar 2010 10:32:27 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D3A33C9C5C; Tue, 16 Mar 2010 10:32:26 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1B3BCC9C5C for ; Tue, 16 Mar 2010 10:32:20 +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 VJI-oNYLfHRf for ; Tue, 16 Mar 2010 10:32:10 +0100 (CET) Original-Received: from deliver.uni-koblenz.de (deliver.uni-koblenz.de [141.26.64.15]) by balder.ntg.nl (Postfix) with ESMTP id 50EACC9BC9 for ; Tue, 16 Mar 2010 10:32:09 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 4B14778A4317 for ; Tue, 16 Mar 2010 10:32:09 +0100 (CET) Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00659-06 for ; Tue, 16 Mar 2010 10:32:08 +0100 (CET) X-CHKRCPT: Envelopesender noch aharder@uni-koblenz.de Original-Received: from [192.168.1.112] (77-23-29-238-dynip.superkabel.de [77.23.29.238]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTP id 9EF6E78A431A for ; Tue, 16 Mar 2010 10:32:08 +0100 (CET) In-Reply-To: <4B9ED1A5.8050809@googlemail.com> X-Mailer: Apple Mail (2.1077) X-Virus-Scanned: amavisd-new at uni-koblenz.de 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:57151 Archived-At: --Apple-Mail-3-514435659 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 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 = correct, otherwise \TestSpace is ignored =85 >> =20 > \def\DefineSectionBlank > {\dotripleempty\doDefineSectionBlank} >=20 > \def\doDefineSectionBlank[#1][#2][#3]#4% > {\edef\CurrentSection{#1}% > \setvalue{#1:#2:\ifthirdargument\the\dimexpr#3\relax\fi}{#4}} >=20 > \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}} >=20 > \let\LastSectionBlankSignal\zeropoint >=20 > \EveryPar{\let\LastSectionBlankSignal\zeropoint} >=20 > \def\SectionBlankSignal > = {\setevalue{LastSectionBlankSignal}{\the\dimexpr\csname\CurrentSection = Signal\endcsname\relax}} >=20 > % chapter >=20 > \DefineSectionBlank [Chapter] [before] {\blank[force,48pt]} > \DefineSectionBlank [Chapter] [after] {\blank[20pt]} >=20 > \newsignal\ChapterSignal >=20 > \setuphead > [chapter] > [before=3D\SectionBlank{Chapter}{before}, > after=3D\SectionBlank{Chapter}{after}] >=20 > % section >=20 > \newsignal\SectionSignal >=20 > \DefineSectionBlank [Section] [before] [\ChapterSignal] {\blank[18pt]} > \DefineSectionBlank [Section] [before] {\blank[24pt]} > \DefineSectionBlank [Section] [after] {\blank[18pt]} >=20 > \setuphead > [section] > [before=3D\SectionBlank{Section}{before}, > after=3D\SectionBlank{Section}{after}] >=20 > \showgrid >=20 > \starttext >=20 > \chapter{Chapter} >=20 > \section{Section} >=20 > \chapter{Chapter}\edef\CurrentSection{Section}\SectionBlankSignal % = tell \section the last header was \section too! >=20 > \section{Section} >=20 > \chapter{Chapter} >=20 > text >=20 > \section{Section} >=20 > \stoptext Hello Wolfgang, thank you for your elaborate example! In the meantime I played a little with weak/strong blanks, before I = figured out that this already works out of the box. It seams that the = blank before 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? --Apple-Mail-3-514435659 Content-Disposition: attachment; filename=test-consecutive-heads3.tex Content-Type: application/octet-stream; name="test-consecutive-heads3.tex" Content-Transfer-Encoding: 7bit \setuplayout[grid=yes] \showgrid[lines] \setupheads[color=blue] \setuphead [chapter] [grid=min, page=no] \setuphead [section] [grid=min] % \setuphead % [subsection] % [before=\blank] \starttext \startcolumns \chapter{Chapter} \section{Section} \dorecurse{25}{some text, } \chapter{Chapter} \dorecurse{10}{some text, } \section{Section} \dorecurse{10}{some text, } \stopcolumns \page \startcolumns \chapter{Chapter} \section{Section} \subsection{Subsection} \subsubsection{Subsubsection} \subsubsubsection{Subsubsubsubsection} \dorecurse{60}{some text, } \chapter{Chapter} \section{Section} \dorecurse{10}{some text, } \subsection{Subsection} \dorecurse{10}{some text, } \subsubsection{Subsubsection} \dorecurse{10}{some text, } \subsubsubsection{Subsubsubsubsection} \dorecurse{10}{some text, } \dorecurse{10}{some text, } \stopcolumns \page \startcolumns \chapter{Chapter\\Chapter} \section{Section\\Section} \subsection{Subsection\\Subsection} \subsubsection{Subsubsection\\Subsection} \subsubsubsection{Subsubsubsubsection\\Subsubsubsubsection} \dorecurse{60}{some text, } \chapter{Chapter\\Chapter} \section{Section\\Section} \dorecurse{10}{some text, } \subsection{Subsection\\Subsection} \dorecurse{10}{some text, } \subsubsection{Subsubsection\\Subsection} \dorecurse{10}{some text, } \subsubsubsection{Subsubsubsubsection\\Subsubsubsubsection} \dorecurse{20}{some text, } \stopcolumns \stoptext %%% Local Variables: %%% mode: context %%% TeX-master: t %%% End: --Apple-Mail-3-514435659 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Greeting Andreas --Apple-Mail-3-514435659 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --Apple-Mail-3-514435659--