Possible Duplicate:
macro names with special characters

When I use \yyy defined bellow it does not print yyy, but if I use \xxx it prints xxx. How can I make \yyy work?

\def\yyy{\csname P1\endcsname}
\def\xxx{\csname PA\endcsname}

marked as duplicate by Stephen, egreg, Stefan Kottwitz Jan 25 '13 at 20:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


There are ways around this:

  • Use roman numerals rather than arabic ones. For example:

  • Use the \csname...\endcsname directive for all things non-letter. For example (note the required expansion):

    \expandafter\def\csname P1\endcsname{yyy}
    \def\yyy{\csname P1\endcsname}
  • Use \@namedef and \@nameuse. For example:


Regardless, I think one can always get away with not using numerals in control sequences.

  • Those are interesting workarounds, but as you say, the first option seems to be the better. Thanks – mljrg Jan 26 '13 at 9:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.