Consider the following:

\show\1 \show\2

The result is

> \1=the letter X.

> \2=macro:

Is it possible to ‘expand’ the meaning of \1 so that \2 contains just X? The only solution I can think of is to use \meaning on \1 and cut out the prefix, but that doesn't seem very elegant.

(Context: I'm writing a scanning function that looks ahead at the next token and then either adds it to a scratch variable or terminates the scanning. Can't add it to the scratch variable without expanding it first, though! But it's not the context that I care about, since I can do the loop in another way; I'm interested in this particular question.)

  • Maybe we should ask Taco to add such a function to the token library.
    – Philipp
    Commented Dec 24, 2010 at 12:21
  • 1
    Please make this site more user friendly! I wanted to comment (actually ask a question) on Joseph's answer, but I couldn't.
    – Ahmed Musa
    Commented Jan 8, 2011 at 22:07
  • @Pluto: Welcome to TeX.SX! This site limits what you can do by how much reputation you have, as explained in the FAQ. To leave comments, you need to get 50 reputation. If you have questions about how this site works, please ask over on meta, and use answers just for something which answers the question. (Deleting this one would probably be a good idea.) I hope you stick around here :) Commented Jan 8, 2011 at 22:07
  • @Pluto: I think Antal S-Z forgot to mention the most important point: If you've got a question, don't ask it in a comment. Please ask a new question, using "Ask Question", and link to this one if you need to refer to it. Commented Jan 8, 2011 at 22:07
  • @Antal: Before you welcome a user to our site, have a look at his user profile. He could have welcomed you! Commented Jan 8, 2011 at 22:07

1 Answer 1


You can't expand a token which has been defined using \let (unless of course we are taking about something \let to another macro). As you say, \meaning is the only way that is going to work. Sorry if this is something of a non-answer!

  • Yeah, hence my use of the word expand in quotes. I suspected this might be the case, though! Cheers :-) Commented Oct 5, 2010 at 12:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .