[texhax] Composing two commands one inside another

Rodolfo Medina romeomedina at libero.it
Wed Aug 11 23:17:58 CEST 2004


>> Please anyone who can help?
>> (Sorry for my ignorance!)
>
>I'm sure you're not ignorant, but your explanation is distincly unclear!

I'll try to be more precise.
I use plain TeX, with eplain macros for cross references.
Suppose I say

\definexref{label}{mouse, cat, }{}

and, some lines below,

\refn{label}

. This expands to:

mouse, cat,

. Now, if I define

\edef\a#1{Hallo, #1!}

and then I say

\a{\refn{label}}

, I get

Hallo, mouse, cat, !

Right. But if I define instead

\edef\b#1, #2, {Hallo, #1, #2, !}

and then I say

\b{\refn{label}}

I get an error message:

! Paragraph ended before \b was complete.

I'd need to know a correct way to "put \refn into \b"
so to obtain the same expansion I get putting \refn into \a with
"\a{\refn{label}}".
The idea is that \b should collect the expansion of \refn{label}
and go ahead with its own expansion:
the value assumed by the one-argument function \refn
should be argument for the two-argument function \b. I also tried with:
\edef\c#1{\expandafter\b{\refn{#1}}}

and then I said

\c{label}

but still got an error message:

! Argument of \b has an extra }.


Any help will be highly appreciated.
                                Rodolfo




More information about the texhax mailing list