* Counter[way=bypage] bug in latest beta?
@ 2015-06-29 12:35 mf
2015-06-30 12:35 ` Wolfgang Schuster
0 siblings, 1 reply; 3+ messages in thread
From: mf @ 2015-06-29 12:35 UTC (permalink / raw)
To: ntg-context
Hello list,
consider this example, involving a number (counter) to be reset at each
page:
\starttext
\definenumber[MyNumber][way=bypage] % MyNumber=0
\incrementnumber[MyNumber] % MyNumber=1
\incrementnumber[MyNumber] % MyNumber=2
mynumber is \rawcountervalue[MyNumber]. % prints 2
\page % MyNumber=0
\incrementnumber[MyNumber] % MyNumber=1
At the new page, mynumber is \rawcountervalue[MyNumber].
\stoptext
In ConTeXt 2014.05.21 22:04 (the one I get as Debian package) it works
as expected, giving MyNumber=1 at page 2, because MyNumber gets reset
at page break.
In the latest beta (and also in 2014.04.01) the counter does not reset
and it's equal to 3 at the end of page 2.
Another question: when you comment out the increment at page 2, the
counter does not reset, and you get 2 even in version 2014.05.21.
\starttext
\definenumber[MyNumber][way=bypage] % MyNumber=0
\incrementnumber[MyNumber] % MyNumber=1
\incrementnumber[MyNumber] % MyNumber=2
mynumber is \rawcountervalue[MyNumber]. % prints 2
\page % MyNumber=0
% \incrementnumber[MyNumber] COMMENTED OUT
At the new page, mynumber is \rawcountervalue[MyNumber]. % prints 2
\stoptext
Is this a bug or is it the way it should work when you don't increment
it?
___________________________________________________________________________________
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
* Re: Counter[way=bypage] bug in latest beta?
2015-06-29 12:35 Counter[way=bypage] bug in latest beta? mf
@ 2015-06-30 12:35 ` Wolfgang Schuster
2015-06-30 20:14 ` mf
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2015-06-30 12:35 UTC (permalink / raw)
To: massifr, mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1800 bytes --]
> mf <mailto:massifr@fastwebnet.it>
> 29. Juni 2015 14:35
> Hello list,
> consider this example, involving a number (counter) to be reset at each
> page:
>
> \starttext
> \definenumber[MyNumber][way=bypage] % MyNumber=0
> \incrementnumber[MyNumber] % MyNumber=1
> \incrementnumber[MyNumber] % MyNumber=2
> mynumber is \rawcountervalue[MyNumber]. % prints 2
> \page % MyNumber=0
> \incrementnumber[MyNumber] % MyNumber=1
> At the new page, mynumber is \rawcountervalue[MyNumber].
> \stoptext
>
> In ConTeXt 2014.05.21 22:04 (the one I get as Debian package) it works
> as expected, giving MyNumber=1 at page 2, because MyNumber gets reset
> at page break.
> In the latest beta (and also in 2014.04.01) the counter does not reset
> and it's equal to 3 at the end of page 2.
>
> Another question: when you comment out the increment at page 2, the
> counter does not reset, and you get 2 even in version 2014.05.21.
>
> \starttext
> \definenumber[MyNumber][way=bypage] % MyNumber=0
> \incrementnumber[MyNumber] % MyNumber=1
> \incrementnumber[MyNumber] % MyNumber=2
> mynumber is \rawcountervalue[MyNumber]. % prints 2
> \page % MyNumber=0
> % \incrementnumber[MyNumber] COMMENTED OUT
> At the new page, mynumber is \rawcountervalue[MyNumber]. % prints 2
> \stoptext
>
> Is this a bug or is it the way it should work when you don't increment it?
It’s a bug and hopefully fixed in a new beta but the counter is only reset
when you increment the value.
BTW: The names for the counter commands are \...counter, e.g.
\definecounter[testcounter][way=bypage]
\define\TestCounter
{\incrementcounter[testcounter]
%\convertedcounter[testcounter]
\rawcountervalue [testcounter]}
\starttext
\dorecurse{3}{\TestCounter\page}
\stoptext
Wolfgang
[-- Attachment #1.2: Type: text/html, Size: 2868 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
* Re: Counter[way=bypage] bug in latest beta?
2015-06-30 12:35 ` Wolfgang Schuster
@ 2015-06-30 20:14 ` mf
0 siblings, 0 replies; 3+ messages in thread
From: mf @ 2015-06-30 20:14 UTC (permalink / raw)
To: mailing list for ConTeXt users
> >
> BTW: The names for the counter commands are \...counter, e.g.
>
> \definecounter[testcounter][way=bypage]
>
> \define\TestCounter
> {\incrementcounter[testcounter]
> %\convertedcounter[testcounter]
> \rawcountervalue [testcounter]}
>
> \starttext
> \dorecurse{3}{\TestCounter\page}
> \stoptext
>
> Wolfgang
Thanks Wolfgang.
I used \definenumber, \incrementnumber, etc. because I read this:
http://wiki.contextgarden.net/Counters
Should that page be updated? I can do it, but I'd like to know
something more about the two forms:
Is \definenumber the mkII way and \definecounter the mkIV one?
Or are they simply synomyms, being \definecounter the preferred one?
___________________________________________________________________________________
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:[~2015-06-30 20:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-29 12:35 Counter[way=bypage] bug in latest beta? mf
2015-06-30 12:35 ` Wolfgang Schuster
2015-06-30 20:14 ` mf
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).