ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Skipping two
@ 2006-07-07  6:55 David Arnold
  2006-07-07 11:27 ` Peter Rolf
  0 siblings, 1 reply; 2+ messages in thread
From: David Arnold @ 2006-07-07  6:55 UTC (permalink / raw)
  Cc: Jacob Prystowsky

All,

Why does this increment by two?

\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

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

* Re: Skipping two
  2006-07-07  6:55 Skipping two David Arnold
@ 2006-07-07 11:27 ` Peter Rolf
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Rolf @ 2006-07-07 11:27 UTC (permalink / raw)


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

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

end of thread, other threads:[~2006-07-07 11:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-07  6:55 Skipping two David Arnold
2006-07-07 11:27 ` Peter Rolf

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