From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/84856 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Peter_M=C3=BCnster?= Newsgroups: gmane.comp.tex.context Subject: total number of sections Date: Wed, 16 Oct 2013 16:44:24 +0200 Message-ID: <87iowxjmwn.fsf@micropit.couberia.selfip.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1381934676 25090 80.91.229.3 (16 Oct 2013 14:44:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Oct 2013 14:44:36 +0000 (UTC) To: ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Oct 16 16:44:39 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VWSKz-0006GS-96 for gctc-ntg-context-518@m.gmane.org; Wed, 16 Oct 2013 16:44:37 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5031D10214; Wed, 16 Oct 2013 16:41: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 (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id uh0n2pDhr5BR; Wed, 16 Oct 2013 16:41:50 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id D577E10209; Wed, 16 Oct 2013 16:41:49 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 68D5810209 for ; Wed, 16 Oct 2013 16:41:48 +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 xk98Z5Z55MYn for ; Wed, 16 Oct 2013 16:41:43 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id B4148101EF for ; Wed, 16 Oct 2013 16:41:43 +0200 (CEST) Original-Received: from smtp.smtpout.orange.fr (smtp04.smtpout.orange.fr [80.12.242.126]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r9GEmtQp006225 for ; Wed, 16 Oct 2013 16:48:56 +0200 Original-Received: from micropit.couberia.selfip.net ([86.214.41.103]) by mwinf5d07 with ME id dqkR1m00F2DYwQu03qkR3f; Wed, 16 Oct 2013 16:44:25 +0200 Original-Received: by micropit.couberia.selfip.net (Postfix, from userid 1000) id DB087A606E6; Wed, 16 Oct 2013 16:44:24 +0200 (CEST) Mail-Followup-To: ConTeXt users User-Agent: Gnus/5.130008 (=?utf-8?Q?=E7=9C=9F?= Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.12.242.126; country=FR; latitude=48.8600; longitude=2.3500; http://maps.google.com/maps?q=48.8600,2.3500&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01KBOMTT5 - 3aaa45d5b1e0 - 20131016 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.72 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:84856 Archived-At: Hi, How could I get the number of sections in a document please? Example application: --8<---------------cut here---------------start------------->8--- \doif{\nofsections}{1}{\setuphead[section][number=no]} \starttext \startsection[title=title 1] section 1 \stopsection %\startsection[title=title 2] section 2 \stopsection \stoptext --8<---------------cut here---------------end--------------->8--- I've done it like this: --8<---------------cut here---------------start------------->8--- \definedataset[mydata] \doif{\datasetvariable{mydata}{1}{nofsecs}}{1}{\setuphead[section][number=no]} \starttext \startsection[title=title 1] section 1 \stopsection %\startsection[title=title 2] section 2 \stopsection \setdataset[mydata][nofsecs=\structurenumber] \stoptext --8<---------------cut here---------------end--------------->8--- But I don't know, if this is the right way... TIA for any help, -- Peter ___________________________________________________________________________________ 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 ___________________________________________________________________________________