Command/macro name cannot include numbers and symbols

A long time ago in a galaxy far, far away....

someone wrote this:

http://web.archive.org/web/20130727172127/http://www.elec.ryukoku.ac.jp/~fujii/pub/ftp/incoming/styles/kth.se/numdef.sty


By the rules of TeX syntax, the "name" of a macro that starts with a \ (backslash) character must either

  • consist of a single non-alphabetical character. Some examples: \, (insert thin space), \% ( the % character), \\ (insert line break), \[ (open display math), and \) (close inline math).

or

  • contain only uppercase and lowercase alphabetical characters: a-z and A-Z. No numerals, and no other characters belonging to non-letter categories either. (Well, there are certain ways of assigning "letter-category" status to non-letter characters, but that's a topic for a different discussion.)

Therefore, \EJ471 is not a valid macro name.

However, you could define a somewhat more general macro:

\newcommand{\EJ}[1]{\includegraphics[scale=0.150]{EJ_#1.jpg}}

and use it as in \EJ{471} to pass EJ_471.jpg to the \includegraphics command. If you needed to process further jpg files that start with EJ_ (and end in .jpg, of course), you could simply keep invoking this macro with the appropriate arguments.