[texhax] Problem with \LaTeX macro

Robin Fairbairns Robin.Fairbairns at cl.cam.ac.uk
Sun Apr 24 22:29:41 CEST 2005


> The following minimal file
> 
> \documentclass{article}
> \def\@{\char'100}
> \begin{document}
> \LaTeX 2e
> \end{document}
> 
> leads to an error message.  If you remove the 2 it doesn't.  Any number 
> from 1 to 7 will casue the error message, but 8 and 9 (nor any other 
> character I tested) does.  The message is 
> 
> "Bad character code"
> 
> and then "e".  This occurs in a paper submitted by an online journal and I 
> can obviously do whatever he wants in a different, but I am curious what 
> is going on.

1) it's bad news to redefine an internal latex command, such as \@;
   latex has a tendency to use \@ all over the place, so you're going
   to get your \char'100 similarly all over the place.  \LaTeX is a
   command that does that.  it's because of the potential for this
   sort of error that the \newcommand command was designed.
2) there's a latex macro \LaTeXe for latex2e
3) you've committed the bug of not terminating the number in your
   command: \def\atsign{\char'100 } works fine.  knuth has a lot about
   that bug in the texbook somewhere.

finally, why do you want a macro to produce an @ sign?  what do you
have against typing @ when you need an @ sign?



More information about the texhax mailing list