10

Common practice for naming packages and classes seems to be, using regex-like notation:

[a-z][a-z0-9]*

In other words, the name usually starts by a lowercase letter, followed by any sequence of lowercase letters and digits.

However, some packages (e.g. tikz-3dplot) and classes (e.g. revtex4-1) contain a - in their name. I am myself tempted to use a dash in the name of one of my packages. Is that wise? Aside from perhaps inconveniencing some users by deviating from naming conventions...

... Are there potential side-effects associated with using a dash in a package/class name?

2
  • 3
    should be OK: any normal ascii value, main thing to watch out for is punctuation characters that babel uses for shorthands, although mostly babel does that after begin{document} these days so should not affect package names. Jan 15, 2014 at 12:58
  • syntax highlighting might be off
    – Sterling
    Oct 11, 2021 at 20:42

1 Answer 1

11

It should be OK: any normal ASCII value. The main thing to watch out for is punctuation characters that babel uses for shorthands, although mostly babel does that after \begin{document} these days so even those should not affect package names.

Also avoid characters that are special in the underlying kpathsea library for example " is used to delimit files with spaces in their names and optionally file names starting | are treated as a shell command to execute. It's probably best to avoid those.

Finally, avoid spaces or commas as they would seriously mess up the \usepackage parsing. You can input a file called array,longtable.sty into TeX but \usepackage{array,longtable} isn't going to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.