ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* setupinteraction kills dodoubleargument
@ 2011-11-21 13:25 Hans van der Meer
  2011-11-21 13:55 ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Hans van der Meer @ 2011-11-21 13:25 UTC (permalink / raw)
  To: ConTeXt NTG

[-- Attachment #1: Type: text/plain, Size: 1186 bytes --]

In my documents I use a macro in footnotes, which is defined though \dodoubleargument.
However, enabling interactions (which must be done too) plays havoc with \dodoubleargument, though \dosingleargument seems to escape unharmed.

Why is this? Can it be repaired?

Hans van der Meer

% Indexing in footnotes
\setuppapersize[A5][A5]
\setupinteraction[state=start] % [state=stop] => OK
\starttext
\type{ConTeXt  ver: 2011.11.17 23:31 MKIV}\blank
\def\testa{\dosingleargument\dotesta}
\def\dotesta[#1]#2{<#1><#2>}
OK: \type{\testa{abc}} \testa{abc}\par
OK: \type{\testa[def]{abc}} \testa[def]{abc}\par
OK: Now in footnote\footnote{testa{abc}}\par
OK: Now in footnote\footnote{\testa[def]{abc}}\par
\blank
\def\testb{\dodoubleargument\dotestb}
\def\dotestb[#1][#2]#3{<#1><#2><#3>}
OK: \type{\testb{abc}} \testb{abc}\par
OK: \type{\testb[def]{abc}} \testb[def]{abc}\par
OK: \type{\testb[ghi][def]{abc}} \testb[ghi][def]{abc}\par
OK: Now in footnote\footnote{testb{abc}}\par
ERROR: Now in footnote\footnote{\testb[def]{abc}}\par
errmessage: ! Argument of \string\dotestb\ has an extra \}.\par
OK: Now in footnote\footnote{\testb[ghi][def]{abc}}\par
\stoptext



[-- Attachment #2: withindex.pdf --]
[-- Type: application/pdf, Size: 17870 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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: setupinteraction kills dodoubleargument
  2011-11-21 13:25 setupinteraction kills dodoubleargument Hans van der Meer
@ 2011-11-21 13:55 ` Wolfgang Schuster
  2011-11-21 14:50   ` Meer, H. van der
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2011-11-21 13:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 21.11.2011 um 14:25 schrieb Hans van der Meer:

> In my documents I use a macro in footnotes, which is defined though \dodoubleargument.
> However, enabling interactions (which must be done too) plays havoc with \dodoubleargument, though \dosingleargument seems to escape unharmed.
> 
> Why is this? Can it be repaired?

Change your definition for \testa and \testb to

  \unexpanded\def\testa{\dosingleempty\dotesta}

and

  \unexpanded\def\testb{\dodoubleempty\dotestb}

Wolfgang
___________________________________________________________________________________
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: setupinteraction kills dodoubleargument
  2011-11-21 13:55 ` Wolfgang Schuster
@ 2011-11-21 14:50   ` Meer, H. van der
  2011-11-21 15:45     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Meer, H. van der @ 2011-11-21 14:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On 21 nov. 2011, at 14:55, Wolfgang Schuster wrote:

> 
> Am 21.11.2011 um 14:25 schrieb Hans van der Meer:
> 
>> In my documents I use a macro in footnotes, which is defined though \dodoubleargument.
>> However, enabling interactions (which must be done too) plays havoc with \dodoubleargument, though \dosingleargument seems to escape unharmed.
>> 
>> Why is this? Can it be repaired?
> 
> Change your definition for \testa and \testb to
> 
>  \unexpanded\def\testa{\dosingleempty\dotesta}

Not needed, because \dosingleargument, \dosingleempty are not harmed.
> 
> and
> 
>  \unexpanded\def\testb{\dodoubleempty\dotestb}

This is a solution, so I can go on with my document.

But isn't it better in general when the problem is solved in \footnote? Because outside it I encountered no problem with the \dodouble's. It would be a pity if everyone who tries to something of the sort, will have to tackle this problem (unless looking into the archives of this group, of course). I was lucky, because the addition of \setupinteraction[state=start] was one of the last things I changed and thus suggested itself readily as the source of the troubles. 
Maybe it can be put on some todo/later-todo list?
> 
> Wolfgang
> ___________________________________________________________________________________

Hans van der Meer



___________________________________________________________________________________
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: setupinteraction kills dodoubleargument
  2011-11-21 14:50   ` Meer, H. van der
@ 2011-11-21 15:45     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2011-11-21 15:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 21-11-2011 15:50, Meer, H. van der wrote:
>
> On 21 nov. 2011, at 14:55, Wolfgang Schuster wrote:
>
>>
>> Am 21.11.2011 um 14:25 schrieb Hans van der Meer:
>>
>>> In my documents I use a macro in footnotes, which is defined though \dodoubleargument.
>>> However, enabling interactions (which must be done too) plays havoc with \dodoubleargument, though \dosingleargument seems to escape unharmed.
>>>
>>> Why is this? Can it be repaired?
>>
>> Change your definition for \testa and \testb to
>>
>>   \unexpanded\def\testa{\dosingleempty\dotesta}
>
> Not needed, because \dosingleargument, \dosingleempty are not harmed.
>>
>> and
>>
>>   \unexpanded\def\testb{\dodoubleempty\dotestb}
>
> This is a solution, so I can go on with my document.
>
> But isn't it better in general when the problem is solved in \footnote? Because outside it I encountered no problem with the \dodouble's. It would be a pity if everyone who tries to something of the sort, will have to tackle this problem (unless looking into the archives of this group, of course). I was lucky, because the addition of \setupinteraction[state=start] was one of the last things I changed and thus suggested itself readily as the source of the troubles.
> Maybe it can be put on some todo/later-todo list?

not really as do*empty is not the problem .. if \testa is expandable and 
\dosingleargument isn't, you still have an expandable dotesta left

I'll make the \do*arguments unexpandable (just like their cousins) but 
it won't help you much

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:[~2011-11-21 15:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-21 13:25 setupinteraction kills dodoubleargument Hans van der Meer
2011-11-21 13:55 ` Wolfgang Schuster
2011-11-21 14:50   ` Meer, H. van der
2011-11-21 15:45     ` 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).