0

I would like to use numbers in \newcommand names. Would this be possible ?

\newcommand{\p13}
  {\geometry{paperwidth=13cm,paperheight=21cm}}

\newcommand{\p26} {\geometry{paperwidth=26cm,paperheight=21cm}}

Veak
  • 1
  • 1
    Specifically, yes it is possible, but no, you probably shouldn't do that. If you ask about what you hope to actually accomplish with this (and why), maybe someone can help you find a better approach that fits with the normal TeX syntax. – Willie Wong Sep 18 '23 at 03:05
  • 1
    There are a number of techniques but none of the techniques is particularly good: – Veak Sep 18 '23 at 03:06
  • Welcome @Prego. Yes, you've summarised the situation explained in those answers well: there are a number of methods, none of them good. Rethink your desiderata really is the best advice anybody can give you. Note that short command names are generally problematic, so even if numbers were letters (in TeX parlance), this would still be disrecommended. – cfr Sep 18 '23 at 05:02
  • It all depends on the application, There is a use for numbers and it is unfortunate they are not supported. This is similar to the situation with Camel Case, Although the L3 Programming Layer does accept underscores, a good design step would be to accept underscores everywhere. – Veak Sep 18 '23 at 11:27

0 Answers0