1

Possible Duplicate:
\newcommand name cannot include numbers, e.g., \Mycomand123

I'm trying something that I thought would be simple

\def\test{Hello}
\def\test2{Hello again}
\test
\test2

Since I cannot control the naming I need to do some hacks.

\catcode30 = 11
\catcode31 = 11
\catcode32 = 11

which works for 0 and 1 but not for 2

I have also tried the \catcode´1 etc with the same result.

I get a missing number treated as zero.

If anybody has any ideas on why or another solution to include numbers in the naming of defines it would be much appreciated

Rasmus
  • 219

1 Answers1

2

For the original question:

  1. Number 0, 1, 2 are 48, 49, 50 (decimal) in ASCII, not 30, 31, 32 (hexadecimal).

  2. \catcode`1 should work, but not \catcode´1.

  3. Save number 11 for later use, or use other tricks to access origin numbers. e.g. \def\x{\catcode...} \x

Anyway, it's usually not a good idea to change the catcodes of numbers.

Leo Liu
  • 77,365