[comp.text] More uppercase questions with TeX

adrian@mti.mti.com (Adrian McCarthy) (12/12/89)

I think I understand the problem with this TeX example, but I'm not sure how to
fix it.  The problem seems to stem from the relatively complex TeX parsing
scheme and the relationship between where macro substitution and the intended
case translation occur.

Here's the problem.  The following TeX source:

      \def\xtest{Adrian}
      \def\ytest#1{\uppercase{Hello, #1.}}
      
      \ytest{\xtest}

produces the output:

      HELLO, Adrian.

rather than

      HELLO, ADRIAN.

I've read up on \expandafter which seems the to be the key to getting things
evaluated in the right order, but, alas,  I have been unsuccessful in my
attempts.  Can anyone enlighten me?

Thanks in advance,
Aid.  (adrian@gonzo.mti.com)

P.S.  Those of you who have requested copies of my LaTeX screenplay macros
will have to wait longer than I intended.  It seems I did some real no-no's
that show up on systems which have relatively small amounts of memory set up
for TeX.  The re-write will take place as soon as I finish my Christmas
shopping.