From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/76794 Path: news.gmane.org!not-for-mail From: "Jan Pohanka" Newsgroups: gmane.comp.tex.context Subject: Re: conditional format of headings Date: Fri, 08 Jun 2012 11:22:44 +0200 Message-ID: References: <5A541836-3F3B-41AA-A467-64AEF5A423AA@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1339147375 6026 80.91.229.3 (8 Jun 2012 09:22:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 8 Jun 2012 09:22:55 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Jun 08 11:22:54 2012 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 1ScvPC-0004Mn-2J for gctc-ntg-context-518@m.gmane.org; Fri, 08 Jun 2012 11:22:54 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 46AF5101E6; Fri, 8 Jun 2012 11:22:52 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GHkPMHqmCsR7; Fri, 8 Jun 2012 11:22:50 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C2C4D101E2; Fri, 8 Jun 2012 11:22:50 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 464D3101E2 for ; Fri, 8 Jun 2012 11:22:50 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Hd2nyC0yvidO for ; Fri, 8 Jun 2012 11:22:48 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 2E976101E0 for ; Fri, 8 Jun 2012 11:22:48 +0200 (CEST) Original-Received: from mail-bk0-f41.google.com (mail-bk0-f41.google.com [209.85.214.41]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q589MlcC019416 for ; Fri, 8 Jun 2012 11:22:47 +0200 Original-Received: by bkcjm19 with SMTP id jm19so2212303bkc.14 for ; Fri, 08 Jun 2012 02:22:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:subject:references:content-type:from:date:message-id:in-reply-to :user-agent; bh=ut5XDb8zm4TSBOpnGH9NicgNuCyUfF2CHBMaXM2y2cM=; b=U63DPDkj5RCo8EM7YfrlWqx/Ws3IZxq7W+PVpgqCax5lEVRRZiV6qlvmqFHQDWwtAJ PWZ8bDZoMVJ/7FeAwRAfe7nOKBRLfpSon3lxevPYobb/WCQOx2McHB4JF2pgKN7p9mOd CmAhOVq9pP8DL5iqsTmXLmlXFOd939WnPtBOHpqM2qnyUlfmSIlwSD/IxT+H83kj6mda QQotyVgPHZi2FGiq8p1YM6XHc/acC13R2x4f+fnrTbSZidbdcLzyQpY0iY8qqHX47qxo DR0dDUzQLgKYc++q/GPgvHzRcD6tNgmzUhrEf0xuYCi2uMNMCRWNWBUJVEpkLf+C9gLL JsaQ== Original-Received: by 10.204.151.130 with SMTP id c2mr5519295bkw.125.1339147367093; Fri, 08 Jun 2012 02:22:47 -0700 (PDT) Original-Received: from pohanka-pc ([194.228.143.168]) by mx.google.com with ESMTPS id m2sm6726739bkm.2.2012.06.08.02.22.45 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Jun 2012 02:22:46 -0700 (PDT) In-Reply-To: <5A541836-3F3B-41AA-A467-64AEF5A423AA@googlemail.com> User-Agent: Opera Mail/12.00 (Linux) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03HjJmL62 - 070c620c3969 - 20120608 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.13 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:76794 Archived-At: Far beyond my tex and context skills, but nice :) regards Jan Dne Wed, 06 Jun 2012 14:46:29 +0200 Wolfgang Schuster napsal(a): > > Am 05.06.2012 um 10:34 schrieb Jan Pohanka: > >> Hello, >> >> is it possible to have some "conditional format"? I mean I'd like to >> have different vertical spacing for \section and \subsection when they >> follows immediately each other and when there is some text between them. > > % SectionBlank > > \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:}}}} > > \let\LastSectionBlankSignal\zeropoint > > \EveryPar{\let\LastSectionBlankSignal\zeropoint} > > \def\SectionBlankSignal > {\setevalue{LastSectionBlankSignal}{\the\dimexpr\csname\CurrentSection > Signal\endcsname\relax}} > > % Heading > > \newsignal\PartSignal > > \DefineSectionBlank [Part] [before] {\blank[force,48pt]} > \DefineSectionBlank [Part] [after] {\blank[15pt]\SectionBlankSignal} > > \setuphead > [Part] > [before=\SectionBlank{Part}{before}, > after=\SectionBlank{Part}{after}] > > \newsignal\ChapterSignal > > \DefineSectionBlank [Chapter] [before] [\PartSignal] > {\blank[\the\dimexpr 12pt*200/100-6pt\relax]} > \DefineSectionBlank [Chapter] [before] > {\blank[\the\dimexpr 12pt*200/100\relax]} > \DefineSectionBlank [Chapter] [after] > {\blank[\the\dimexpr 12pt*150/100\relax]\SectionBlankSignal} > > \setuphead > [chapter] > [before=\SectionBlank{Chapter}{before}, > after=\SectionBlank{Chapter}{after}] > > \newsignal\SectionSignal > > \DefineSectionBlank [Section] [before] [\PartSignal] > {\blank[\the\dimexpr 12pt*175/100\relax]} > %\DefineSectionBlank [Section] [before] [\ChapterSignal] > {\blank[\the\dimexpr 12pt*175/100-3pt\relax]} > \DefineSectionBlank [Section] [before] [\ChapterSignal] > {\blank[\the\dimexpr 12pt*175/100+2cm\relax]} > \DefineSectionBlank [Section] [before] > {\blank[\the\dimexpr 12pt*175/100\relax]} > \DefineSectionBlank [Section] [after] > {\blank[\the\dimexpr 12pt*133/100\relax]\SectionBlankSignal} > > \setuphead > [section] > [before=\SectionBlank{Section}{before}, > after=\SectionBlank{Section}{after}] > > \starttext > > \chapter{Chapter 1} > > \section{Section 1.1} > > \chapter{Chapter 2} > > text > > \section{Section 2.1} > > \stoptext > > Wolfgang > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ ___________________________________________________________________________________ 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 ___________________________________________________________________________________