[NTG-context] late reset of counter with way=bypage

massifr at fastwebnet.it massifr at fastwebnet.it
Mon Feb 22 11:38:49 CET 2016


Solved with a workaround
> -----
> \setupnotation[footnote][way=bypage]
> 
> \definecounter[authornote][way=bypage]
> 
> % taken and adapted from https://www.mail-archive.com/ntg-context@ntg.nl/msg56637.html
> \define[1]\authorNote{\bgroup%
>    \savecounter[footnote]%
   \incrementcounter[authornote]\decrementcounter[authornote]%  <-- authornote is incremented and decremented to force the reset by page
>    \setcounter[footnote][{\rawcountervalue[authornote]}]%
>    \setupnotation[footnote][numberconversion=set 1]%
>    \footnote{#1}%
>    \restorecounter[footnote]%
>    \incrementcounter[authornote]%
>    \egroup}
> 
> \starttext
> 
> First footnote\footnote{First footnote}.
> First author's footnote\authorNote{First author's footnote}.
> Second footnote\footnote{Second footnote}.
> Second author's footnote\authorNote{Second author's footnote}.
> 
> \page
> 
> First footnote\footnote{First footnote}.
> First author's footnote\authorNote{First author's footnote}.
> Second footnote\footnote{Second footnote}.
> Second author's footnote\authorNote{Second author's footnote}.
> 
> \stoptext
> -----

Wolfgang Schuster already answered me on this (see https://www.mail-archive.com/ntg-context%40ntg.nl/msg78847.html):
> It’s a bug and hopefully fixed in a new beta but the counter is only reset
> when you increment the value.

If you need the value of a counter with "way=bypage" without modifying its value, the workaround is:
- increment the counter to force its reset by page
- decrement it to get the correct current value

Greetings,
Massi


More information about the ntg-context mailing list