On 11-5-2012 16:59, Peter Schorsch wrote:
\unprotect
\definecounter[ParagraphCounter][way=bysection,prefix=no]
\def\markParagraph[#1]% {\getrawparameters[Paragraph][mark=,#1]% \incrementcounter[ParagraphCounter]% \expanded{\textreference[\Paragraphmark]{\convertedcounter[ParagraphCounter]}}}
\protect
\starttext
\markParagraph[mark=aaa] \input tufte
\markParagraph[mark=bbb] \input tufte
\markParagraph[mark=ccc] Should be 1: \in[aaa]
Should be 2: \in[bbb]
Should be 3: \in[ccc]
\stoptext
you need to use expandable macros like \rawcountervalue: \def\markParagraph[#1]% {\getrawparameters[Paragraph][mark=,#1]% \incrementcounter[ParagraphCounter]% \expanded{\textreference[\Paragraphmark]{\rawcountervalue[ParagraphCounter]}}} this is due to optional argument parsing in the other ones Hans -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------