ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Jaroslav Hajtmar <hajtmar@gyza.cz>
Subject: Re: Disproportion in initializing user counters
Date: Sun, 15 Jul 2018 15:49:05 +0200	[thread overview]
Message-ID: <baff0b83-b964-887c-6b55-ce7f71174357@xs4all.nl> (raw)
In-Reply-To: <3F5673DB-D866-4B1E-A152-DB16E85AAB46@gyza.cz>

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
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2018-07-15 13:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-15 10:33 Jaroslav Hajtmar
2018-07-15 13:49 ` Hans Hagen [this message]
2018-07-15 14:47   ` Pablo Rodriguez
2018-07-15 17:20     ` Wolfgang Schuster
2018-07-15 17:34       ` Pablo Rodriguez
2018-07-15 17:54         ` Rik
2018-07-15 18:10           ` Pablo Rodriguez
2018-07-15 23:18       ` Jaroslav Hajtmar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=baff0b83-b964-887c-6b55-ce7f71174357@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=hajtmar@gyza.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).