how can I reset section counter when recursing buffers?
Hello, When I call a buffer with sections several times, I would like to get the same headers numbers for each buffer call. (So, in my MWE twice 1 and 2, not 1, 2, 3, 4) How can I reset the section counter within a dorecurse run? I tried \resetcounter [section] but that is not the good way. I read about \headnumber and \namedheadnumber but could'nt go further. My MWE: \startbuffer \startsection[title={foo}] \input ward \stopsection \startsection[title={bar}] \input knuth \stopsection \stopbuffer \starttext \dorecurse{2}{ % how can I reset chapter number? \getbuffer } \stoptext Thanks, Damien
Damien Thiriet via ntg-context schrieb am 01.10.2024 um 17:02:
Hello,
When I call a buffer with sections several times, I would like to get the same headers numbers for each buffer call. (So, in my MWE twice 1 and 2, not 1, 2, 3, 4) How can I reset the section counter within a dorecurse run? I tried \resetcounter [section] but that is not the good way. I read about \headnumber and \namedheadnumber but could'nt go further.
My MWE:
\startbuffer \startsection[title={foo}] \input ward \stopsection \startsection[title={bar}] \input knuth \stopsection \stopbuffer
\starttext \dorecurse{2}{ % how can I reset chapter number?
\setupheadnumber[section][0] Wolfgang
Thanks Wolfgang! I wikified your answer, adding a line in «Counters». I also slightly changed the page layout (replacing code examples with links to the command pages). Damien
My MWE:
\startbuffer \startsection[title={foo}] \input ward \stopsection \startsection[title={bar}] \input knuth \stopsection \stopbuffer
\starttext \dorecurse{2}{ % how can I reset chapter number?
\setupheadnumber[section][0]
Wolfgang
participants (2)
-
damien@thiriet.web4me.fr
-
Wolfgang Schuster