ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Peter Rolf <indiego@gmx.net>
Subject: Re: Skipping two
Date: Fri, 07 Jul 2006 13:27:31 +0200	[thread overview]
Message-ID: <44AE4523.7010500@gmx.net> (raw)
In-Reply-To: <B35E566D-635D-404C-8D2E-903505464B68@cox.net>

Hi David,

David Arnold wrote:
> All,
> 
> Why does this increment by two?
>

because the argument of \setuplabeltext is expanded two times per call
(add a \message to your macro). Mostly this is done to collect
information (for size maxima, whatever) in the first run, so you can set
things pretty in the final run.

Just define your macro this way

\define\NonFigCrt{\iftrialtypesetting\else\NonFigCtrUpdate{\tfa\NonFigCounter}\fi}

which filters out the trialtype setting run.

Greetings, Peter

> \setupoutput[pdf]
> 
> \newcounter\NonFigCounter
> \define\NonFigCtrUpdate{\doglobal\increment\NonFigCounter}
> \define\NonFigCtr{\NonFigCtrUpdate{\tfa\NonFigCounter}}
> 
> \setuplabeltext[remark=Remark \NonFigCtr:]
> 
> 	
> \defineenumeration
> 	[remark]
> 	[location=serried,
> 		width=broad,
> 		text=\labeltext{remark},
> 		headstyle=bold,
> 		inbetween=\blank,
> 		before=\blank,
> 		after=\blank,
> 		way=bysection,
> 		number=no]
> 
> \starttext
> 
> \startremark
>    Foo
> \stopremark
> 
> \startremark
>    Foo
> \stopremark
> 
> \stoptext
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

      reply	other threads:[~2006-07-07 11:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-07  6:55 David Arnold
2006-07-07 11:27 ` Peter Rolf [this message]

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=44AE4523.7010500@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).