I experienced some problems when creating \newcommand that have some numbers in their names; I can't find docs about that, about the accepted charset for the commands in LaTeX.
|
|
||||
|
A command name can consist either of one non alphabetic character or a sequence of alphabetic ( Actually the rule is a bit more complicated, but as far as the final user is concerned, this is can be considered the truth. So you can't say If you have in mind some application of command names with numbers, please modify your question so that somebody can suggest you a better alternative. |
|||
|
|
|
You should use only the letters A-Za-z in the user commands. Commands defined in .sty file (or inside If you need numbers for a set of related commands, the usual practice is to use roman numerals, like |
|||||
|
|
There are two basic "flavors", to use Knuth's own terminology, of control sequences in TeX/LaTeX:
Control words may be further differentiated as those that include one or more "at", Given the preceding explanations, it's clear that what you've run into is the fact that you should not be using numerals (or any other other nonletter characters) in a control word. (If you think you simply must use some numbers in the macro, you can write them out as, say, |
||||
|
|
|
You can only use characters in macro names which are officially marked as letters. By default only real letters a-z and A-Z are marked this way. You can however, change this by changing the category code (catcode) for the character to 11 (letter). This is done to the You could change the catcode of virtually any character to 11 and then use it in a macro name, but this may cause issues. (The LaTeX3 project for example uses |
|||
|
|

\@namedefand\@nameuse. Or the package etoolbox provides similar commands. – Marco Daniel Nov 10 '11 at 18:13