[NTG-context] Disproportion in initializing user counters

Hans Hagen j.hagen at xs4all.nl
Sun Jul 15 15:49:05 CEST 2018


On 7/15/2018 12:33 PM, Jaroslav Hajtmar wrote:
> Hello ConTeXist.
> 
> I encountered a disproportion in initializing user counters. Why 
> initialization at the beginning of the source text does not work and 
> what is the mechanism of how the user counters work.
> 
> Thanx Jaroslav Hajtmar
> 
> Here is a sample example:
> 
> \definecounter[mycounter]
> 
> \def\getmycounter{\incrementcounter[mycounter]\getnumber[mycounter]}
> 
> \startbuffer[groups]
> 
>      \startxrow
> 
>      \startxcell \getmycounter\stopxcell
> 
>      \startxcell Content of column\stopxcell
> 
> \stopxrow
> 
> \stopbuffer
> 
> \starttext
> 
> %\setcounter[mycounter][0] % initializing at this point not working (the 
> counter is 10 more than it should be). WHY?
> 
> \startxtable
> 
>      \startxrow
> 
>          \startxcell Column 1\stopxcell
> 
>          \startxcell Column 2\stopxcell
> 
>      \stopxrow
> 
> \setcounter[mycounter][0] % initializing at this point works fine
> 
> \dorecurse{5}{\getbuffer[groups]}
> 
> \stopxtable
> 
> \stoptext

tables take multiple passes so you need to decrement when still 
trialtypesetting

\iftrialtypesetting .. \fi



-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list