1
\newcommand{\1999}{saysomething}
\1999

how to define such command ?

I've tried the \newcommand{\csname 1999 \csname}{saysomething}.

but it brings an error.

  • 3
    \expandafter\newcommand\expandafter{\csname 1999\endcsname}{Foo}. Bit you will not be able to use it as \1999, you have to use it as \csname 1999\endcsname or similar (\makeatletter\@nameuse{1999}\makeatother). In general I would say digits in command names are not worth it. – moewe Aug 09 '19 at 05:42
  • 1
    In theory one could turn digits into letters for TeX so that they are allowed in control sequence names, but that brings with it all sort of other issues so that I can't really recommend that. See https://tex.stackexchange.com/q/317328/35864. – moewe Aug 09 '19 at 05:45
  • 2
    Related: https://tex.stackexchange.com/q/9718/134144 – leandriis Aug 09 '19 at 05:45
  • 1
    You could use Roman numerals instead of Arabic ones. – Peter Wilson Aug 09 '19 at 16:37

1 Answers1

1

TeX has it's idea that only letters can be part of longer (not one-character) command names. You can fool around redefining digits to be letters, or some such, but that will produce more problems than what it is worth.

Just write out your numbers in e.g. Roman (XIX for 19 and so) or use some English abbreviation.

vonbrand
  • 5,473