[NTG-context] Did usage of \expanded changed?

2012-05-11 Thread Peter Schorsch
Hi,

I reactivated some code that was working a year ago. But now it seems
that \expanded has no effect in my case (see below). I also tried it
with \normalexpanded and \expandedafter but both had also no effect. My
problem seems to be this line of the full example below:


\doifsomething\Paragraphmark{\expanded{\textreference[\Paragraphmark]{\fullheadnumber/\rawnumber[ParagraphNumber]}}}%

The error shows itself in the line:

Should be 1/1: \in[test] 

As \in[test] gives me 1/3 instead of 1/1. (1 was the number assigned to
the first paragraph - 3 is the acutal number).

Can someone tell me what I need to change?

Thanks in advanced
P.

-8---full example---

\unprotect

\definenumber[ParagraphNumber][way=bysection,prefixsegments=100]
 
\unexpanded\def\startParagraph
{\dosingleempty\dostartParagraph}
 
\def\dostartParagraph[#1]%
   {\getrawparameters[Paragraph][heading=,mark=,#1]%
\incrementnumber[ParagraphNumber]%
\ininner{\tfx\getnumber[ParagraphNumber]}%
\doifsomething\Paragraphheading{\inouter{\Paragraphheading}}%

\doifsomething\Paragraphmark{\expanded{\textreference[\Paragraphmark]{\fullheadnumber/\rawnumber[ParagraphNumber]}}}%
\ignorespaces}

\unexpanded\def\stopParagraph
{\blank[medium]}
\protect

\starttext

\chapter{Alter novom}

\startParagraph[heading={lorem ipsum},mark=test]
\input tufte
\stopParagraph

\startParagraph
\input tufte
\stopParagraph

\startParagraph
Should be 1/1: \in[test] 
\stopParagraph

\stoptext
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Did usage of \expanded changed?

2012-05-11 Thread Thomas A. Schmitz

On 05/11/2012 01:28 PM, Peter Schorsch wrote:

Hi,

I reactivated some code that was working a year ago. But now it seems
that \expanded has no effect in my case (see below). I also tried it
with \normalexpanded and \expandedafter but both had also no effect. My
problem seems to be this line of the full example below:


\doifsomething\Paragraphmark{\expanded{\textreference[\Paragraphmark]{\fullheadnumber/\rawnumber[ParagraphNumber]}}}%

The error shows itself in the line:

Should be 1/1: \in[test]

As \in[test] gives me 1/3 instead of 1/1. (1 was the number assigned to
the first paragraph - 3 is the acutal number).

Can someone tell me what I need to change?

Thanks in advanced
P.


See this thread: 
http://archive.contextgarden.net/message/20120402.144627.e46a9f9f.en.html


and try to construct a minimal example next time.

Thomas
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Did usage of \expanded changed?

2012-05-11 Thread Peter Schorsch
 See this thread: 
 http://archive.contextgarden.net/message/20120402.144627.e46a9f9f.en.html
 
 and try to construct a minimal example next time.

I converted my number to counter and shrinked my example - but the
problem still occurs:

Instead of the counter value when I set the reference I get always the
latest value:

Should be 1: 3
Should be 2: 3
Should be 3: 3

instead of 

Should be 1: 1
Should be 2: 2
Should be 3: 3

---8--shrinked example--

\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
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Did usage of \expanded changed?

2012-05-11 Thread Hans Hagen

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
-
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___