From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/78256 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Adaptive section structuring Date: Thu, 13 Sep 2012 10:10:55 +0200 Message-ID: <5051950F.3020404@wxs.nl> References: <20120913094842.741df22a@homerow> 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" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1347523865 15793 80.91.229.3 (13 Sep 2012 08:11:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Sep 2012 08:11:05 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Sep 13 10:11:09 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 1TC4Vx-0004Gl-8i for gctc-ntg-context-518@m.gmane.org; Thu, 13 Sep 2012 10:11:09 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2D4EE101FA; Thu, 13 Sep 2012 10:11:05 +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 AjAcuHcK8fcx; Thu, 13 Sep 2012 10:11:03 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 82881101EF; Thu, 13 Sep 2012 10:11:03 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A9173101EF for ; Thu, 13 Sep 2012 10:11:01 +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 WZ7zHa-NYWkZ for ; Thu, 13 Sep 2012 10:11:00 +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 B618F101E9 for ; Thu, 13 Sep 2012 10:11:00 +0200 (CEST) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q8D8Awej019517 for ; Thu, 13 Sep 2012 10:10:58 +0200 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.100; Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by pragma-net.nl (SurgeMail 6.1c) with ESMTP (TLS) id 6070-1713362 for multiple; Thu, 13 Sep 2012 10:10:54 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 In-Reply-To: <20120913094842.741df22a@homerow> X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=16; city=Zeewolde; latitude=52.3302; longitude=5.5364; http://maps.google.com/maps?q=52.3302,5.5364&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03HWwaWNJ - 2b170e868ec5 - 20120913 (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.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:78256 Archived-At: On 13-9-2012 09:48, Marco Patzer wrote: > Hi, > > I am often surprised that some nice-to-have feature is already > present in ConTeXt and I just wasn't aware. But I am not sure about > this one. > > Is there something like an adaptive structure code which keeps track > of the nesting level? In this example the first structure would > become the chapter, the second one a section, etc. > > \starttext > \startstructure [title=Alpha] > \startstructure [title=Beta] > \startstructure [title=Gamma] > \stopstructure > \stopstructure > \stopstructure > \stoptext > > This would ease moving around sections, which might end up as > subsections and vice versa. There has always been this trick: \definehead[level-1][chapter] \definehead[level-2][section] \definehead[level-3][subsection] \startnamedsection[level-1][title=Alpha] \startnamedsection[level-2][title=Beta] \startnamedsection[level-3][title=Gamma] 1-2-3 \stopnamedsection \stopnamedsection \stopnamedsection or \definehead[levelone][chapter] \definehead[leveltwo][section] \definehead[levelthree][subsection] \startlevelone[title=Alpha] \startleveltwo[level-2][title=Beta] \startlevelthree[level-3][title=Gamma] but there's also \startstructurelevel [title=first lower level] \startstructurelevel [title=second lower level] \startstructurelevel [title=third lower level] test \stopstructurelevel \stopstructurelevel \stopstructurelevel and here's 'level-002.tex' from the test suite: \definehead[xxxxxxsection][subsubsection] \setuphead [xxxxxxsection][color=red] \definestructurelevels[main][chapter,section,subsection,subsubsection] \definestructurelevels[next][chapter,section,subsection,xxxxxxsection] \starttext \startstructurelevel [main] [title=first top level] \startstructurelevel [main] [title=first lower level] \startstructurelevel [main] [title=second lower level] \startstructurelevel [main] [title=third lower level] test \stopstructurelevel \stopstructurelevel \stopstructurelevel \startstructurelevel [main] [title=first lower level] \startstructurelevel [main] [title=second lower level] \startstructurelevel [next] [title=third lower level] test \stopstructurelevel \stopstructurelevel \stopstructurelevel \stopstructurelevel \stoptext Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________