From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/76734 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: conditional format of headings Date: Wed, 6 Jun 2012 14:46:29 +0200 Message-ID: <5A541836-3F3B-41AA-A467-64AEF5A423AA@googlemail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1338986804 22905 80.91.229.3 (6 Jun 2012 12:46:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 6 Jun 2012 12:46:44 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jun 06 14:46:41 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 1ScFdG-0005SO-Ef for gctc-ntg-context-518@m.gmane.org; Wed, 06 Jun 2012 14:46:38 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9993C101E3; Wed, 6 Jun 2012 14:46:37 +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 B-LO-IaG70eC; Wed, 6 Jun 2012 14:46:37 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A5F9B101DF; Wed, 6 Jun 2012 14:46:35 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E1AD2101DF for ; Wed, 6 Jun 2012 14:46:33 +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 t3Lj+EEdD8AZ for ; Wed, 6 Jun 2012 14:46:32 +0200 (CEST) Original-Received: from filter3-nij.mf.surf.net (filter3-nij.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id AFAB9101DD for ; Wed, 6 Jun 2012 14:46:32 +0200 (CEST) Original-Received: from mail-bk0-f41.google.com (mail-bk0-f41.google.com [209.85.214.41]) by filter3-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q56CkVrE014065 for ; Wed, 6 Jun 2012 14:46:32 +0200 Original-Received: by bkcjm19 with SMTP id jm19so7646045bkc.14 for ; Wed, 06 Jun 2012 05:46:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=WOwxWOrD7BgZZEBMAa/uW7wFOGak5adW/0sB9mQxTkk=; b=sig3lzdvZ0YVO+oPeVQADO0D0DOj8mHeRnOaahuyFl9Ve8e/ExitkDq08pMdaskmLr 9HRNoM1xfafIv7tYoBRLomPxAC6rOMlHMMWLESrLsuQgWpdrGK3FCarDsNFKGmTpFysk hAFtoFkvouwDvaMV/WQIQkkx2Hzfp87LkE2rSalgz9k8vVlAyTkDS454CWzODwFDwp+U KesJodcXYYQVFJiHAmRRaMtfR+czToU4TEX8ZfrwnciniTmLT26WuoM9jmZtpbvvkXIo 217HMtc04wYdA0RpkzdMIUrOmymTazRCcp5+A6phtsIPOlJIO3bYohkWk18cNV9Ndr0H KPyA== Original-Received: by 10.204.143.138 with SMTP id v10mr12135909bku.40.1338986791486; Wed, 06 Jun 2012 05:46:31 -0700 (PDT) Original-Received: from [192.168.2.36] (p57AFBC24.dip.t-dialin.net. [87.175.188.36]) by mx.google.com with ESMTPS id ig1sm2193857bkc.4.2012.06.06.05.46.28 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Jun 2012 05:46:30 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1278) 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: 0dHj0Kvu7 - 30adffe8d659 - 20120606 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 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:76734 Archived-At: 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 ___________________________________________________________________________________