ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Disproportion in initializing user counters
@ 2018-07-15 10:33 Jaroslav Hajtmar
  2018-07-15 13:49 ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Jaroslav Hajtmar @ 2018-07-15 10:33 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 913 bytes --]

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


[-- Attachment #1.2: Type: text/html, Size: 5390 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Disproportion in initializing user counters
  2018-07-15 10:33 Disproportion in initializing user counters Jaroslav Hajtmar
@ 2018-07-15 13:49 ` Hans Hagen
  2018-07-15 14:47   ` Pablo Rodriguez
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2018-07-15 13:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Jaroslav Hajtmar

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Disproportion in initializing user counters
  2018-07-15 13:49 ` Hans Hagen
@ 2018-07-15 14:47   ` Pablo Rodriguez
  2018-07-15 17:20     ` Wolfgang Schuster
  0 siblings, 1 reply; 8+ messages in thread
From: Pablo Rodriguez @ 2018-07-15 14:47 UTC (permalink / raw)
  To: ntg-context

On 07/15/2018 03:49 PM, Hans Hagen wrote:
> 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.
>> [...]
>> \starttext
>>
>> %\setcounter[mycounter][0] % initializing at this point not working (the 
>> counter is 10 more than it should be). WHY?
> 
> tables take multiple passes so you need to decrement when still 
> trialtypesetting
> 
> \iftrialtypesetting .. \fi

Many thanks for your reply, Hans.

The original issue was mine, using with the handlecsv module. And I had
no idea about what was wrong there.

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Disproportion in initializing user counters
  2018-07-15 14:47   ` Pablo Rodriguez
@ 2018-07-15 17:20     ` Wolfgang Schuster
  2018-07-15 17:34       ` Pablo Rodriguez
  2018-07-15 23:18       ` Jaroslav Hajtmar
  0 siblings, 2 replies; 8+ messages in thread
From: Wolfgang Schuster @ 2018-07-15 17:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 397 bytes --]

Hi Pablo,

when you use the label mechanism to create a counter context ensures to 
print the right counter value in the table.

Wolfgang
> Pablo Rodriguez <mailto:oinos@gmx.es>
> 15. Juli 2018 um 16:47
>
> Many thanks for your reply, Hans.
>
> The original issue was mine, using with the handlecsv module. And I had
> no idea about what was wrong there.
>
> Many thanks for your help,
>
> Pablo


[-- Attachment #1.2: Type: text/html, Size: 1405 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Disproportion in initializing user counters
  2018-07-15 17:20     ` Wolfgang Schuster
@ 2018-07-15 17:34       ` Pablo Rodriguez
  2018-07-15 17:54         ` Rik
  2018-07-15 23:18       ` Jaroslav Hajtmar
  1 sibling, 1 reply; 8+ messages in thread
From: Pablo Rodriguez @ 2018-07-15 17:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 07/15/2018 07:20 PM, Wolfgang Schuster wrote:
> Hi Pablo,
> 
> when you use the label mechanism to create a counter context ensures to
> print the right counter value in the table.

Hi Wolfgang,

would it be possible to provide me with a minimal sample?

I don‘t use labels and I don’t know how to use them with counters in
xtables.

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Disproportion in initializing user counters
  2018-07-15 17:34       ` Pablo Rodriguez
@ 2018-07-15 17:54         ` Rik
  2018-07-15 18:10           ` Pablo Rodriguez
  0 siblings, 1 reply; 8+ messages in thread
From: Rik @ 2018-07-15 17:54 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 863 bytes --]

On 7/15/2018 13:34, Pablo Rodriguez wrote:
> On 07/15/2018 07:20 PM, Wolfgang Schuster wrote:
>
>>     Hi Pablo,
>>
>>     when you use the label mechanism to create a counter context ensures to
>>     print the right counter value in the table.
>
> Hi Wolfgang,
>
> would it be possible to provide me with a minimal sample?
>
> I don‘t use labels and I don’t know how to use them with counters in
> xtables.
>
> Many thanks for your help,
>
> Pablo

Easier than counters:

    \definelabel [QQ][text=,headcolor=red]
    \starttext
    \startxtable
       \startxrow
         \startxcell one \stopxcell
         \startxcell two \QQ[there] \stopxcell
       \stopxrow
       \startxrow
         \startxcell alpha \QQ\stopxcell
         \startxcell beta \QQ[here]  \stopxcell
       \stopxrow
    \stopxtable

    See entry \in[here].

    \stoptext

-- 

Rik


[-- Attachment #1.2: Type: text/html, Size: 1337 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Disproportion in initializing user counters
  2018-07-15 17:54         ` Rik
@ 2018-07-15 18:10           ` Pablo Rodriguez
  0 siblings, 0 replies; 8+ messages in thread
From: Pablo Rodriguez @ 2018-07-15 18:10 UTC (permalink / raw)
  To: ntg-context

On 07/15/2018 07:54 PM, Rik wrote:
> Easier than counters:
> 
>     \definelabel [QQ][text=,headcolor=red]
>     \starttext
>     \startxtable
>       \startxrow
>         \startxcell one \stopxcell
>         \startxcell two \QQ[there] \stopxcell
>       \stopxrow
>       \startxrow
>         \startxcell alpha \QQ\stopxcell
>         \startxcell beta \QQ[here]  \stopxcell
>       \stopxrow
>     \stopxtable
> 
>     See entry \in[here].
> 
>     \stoptext

Hi Rik,

I totally agree: this is much easier than counters.

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Disproportion in initializing user counters
  2018-07-15 17:20     ` Wolfgang Schuster
  2018-07-15 17:34       ` Pablo Rodriguez
@ 2018-07-15 23:18       ` Jaroslav Hajtmar
  1 sibling, 0 replies; 8+ messages in thread
From: Jaroslav Hajtmar @ 2018-07-15 23:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 378 bytes --]

Thank very much to explain the problem and to example with labels - very useful information for me.
Thanks to all.
Jaroslav Hajtmar

15. 7. 2018 v 19:20, Wolfgang Schuster <schuster.wolfgang@gmail.com<mailto:schuster.wolfgang@gmail.com>>:

Hi Pablo,

when you use the label mechanism to create a counter context ensures to print the right counter value in the table.


[-- Attachment #1.2: Type: text/html, Size: 2969 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-07-15 23:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-15 10:33 Disproportion in initializing user counters Jaroslav Hajtmar
2018-07-15 13:49 ` Hans Hagen
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

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).