0

I notice that some characters are not allowed in \def\... what are the common rule to separate words in LaTeX command?

  1. camelCase?
  2. kebab-case?
  3. snake_case?
  4. other?

For example how should the command project title be named?

nowox
  • 1,375
  • 1
    (2) and (3) are not allowed with normal document settings (3) is standard L3 code stye – David Carlisle Mar 03 '23 at 16:32
  • In LaTeX commands only letters are allowed,neither - nor _. For internal LaTeX commands also @ are used, but without extra effort this is allowed in packages and classes only. In the expl3 context some other characters are also valid. So an answer depends on what you are doing. BTW: In LaTeX preambles you should avoid \def and prefer \newcommand, \renewcommand, \NewDocumentCommand etc. – cabohah Mar 03 '23 at 16:32
  • If you are writing a package for others to use: Be sure that your commands use a "namespace" prefix. Bad: \dothis. Good: \zzdothis where zz is related to your package name. Same for internal package commands. That prevents conflict with other packages trying to use the same macro names. – rallg Mar 03 '23 at 17:07

0 Answers0