ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* total number of sections
@ 2013-10-16 14:44 Peter Münster
  2013-10-17  8:17 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Münster @ 2013-10-16 14:44 UTC (permalink / raw)
  To: ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-20 23:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-16 14:44 total number of sections Peter Münster
2013-10-17  8:17 ` Hans Hagen
2013-10-20 23:31   ` Peter Münster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).