ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Peter Rolf <indiego@gmx.net>
Subject: Re: feature request: \everytrypass
Date: Thu, 20 Apr 2006 13:01:24 +0200	[thread overview]
Message-ID: <44476A04.6090105@gmx.net> (raw)
In-Reply-To: <4447672D.1050108@seznam.cz>

Vit Zyka wrote:
> Dear ConTeXters,
> 
> I am counting occurence of some macro in the text. Problem is when this 
> macro is inside \bTABLE (and may be somewhere else). Due to try passes 
> the increment is counter is incremented more then once and the result is 
> multiplied.
> 
> It is possible to implement some \everytrypass in which user can (e.g.) 
> null incrementing? Or there is some another solution?
> 
> Thanks
> Vit
> 
> Minimal example:
> -----------------------------------------------
> \newcount\C
> \def\doIncrement{\global\advance\C by1\relax}

\def\doIncrement{\iftrialtypesetting
  \else\global\advance\C by1\relax\fi}%

donno if this works correctly inside a TABLE...


Greets, Peter

> 
> % \def\nullIncrement{\let\doIncrement\relax}
> % \appendtoks \nullIncrement to \everytrypass
> 
> \starttext
>    \bTABLE
>      \bTR\bTD Counter\doIncrement\eTD\eTR
>    \eTABLE
>    \message{ <<Counter=\the\C>> }%
> \stoptext
> ------------------------------------------------
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

  reply	other threads:[~2006-04-20 11:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-20 10:49 Vit Zyka
2006-04-20 11:01 ` Peter Rolf [this message]
2006-04-21 12:57   ` Vit Zyka
2006-04-21 20:06     ` Hans Hagen
2006-04-20 21:55 ` Hans Hagen

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=44476A04.6090105@gmx.net \
    --to=indiego@gmx.net \
    --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).