ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Did usage of \expanded changed?
@ 2012-05-11 11:28 Peter Schorsch
  2012-05-11 12:10 ` Thomas A. Schmitz
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Schorsch @ 2012-05-11 11:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: Did usage of \expanded changed?
  2012-05-11 11:28 Did usage of \expanded changed? Peter Schorsch
@ 2012-05-11 12:10 ` Thomas A. Schmitz
  2012-05-11 14:59   ` Peter Schorsch
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas A. Schmitz @ 2012-05-11 12:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: Did usage of \expanded changed?
  2012-05-11 12:10 ` Thomas A. Schmitz
@ 2012-05-11 14:59   ` Peter Schorsch
  2012-05-11 15:40     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Schorsch @ 2012-05-11 14:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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


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

* Re: Did usage of \expanded changed?
  2012-05-11 14:59   ` Peter Schorsch
@ 2012-05-11 15:40     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2012-05-11 15:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

end of thread, other threads:[~2012-05-11 15:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-11 11:28 Did usage of \expanded changed? Peter Schorsch
2012-05-11 12:10 ` Thomas A. Schmitz
2012-05-11 14:59   ` Peter Schorsch
2012-05-11 15:40     ` Hans Hagen

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