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
On 10/16/2013 4:44 PM, Peter Münster wrote:
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...
\determinelistcharacteristics[section][criterium=text] \ifnum\structurelistsize=1 ... \fi ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On Thu, Oct 17 2013, Hans Hagen wrote:
\determinelistcharacteristics[section][criterium=text] \ifnum\structurelistsize=1 ... \fi
Thanks. Now I've found another example on the mailing list: \determinelistcharacteristics[section][criterium=all] number of sections: \utilitylistlength That works too. What is the difference between criterium=all and criterium=text? And what is the difference between \structurelistsize and \utilitylistlength? TIA, -- Peter
participants (2)
-
Hans Hagen
-
Peter Münster