Possible Duplicate:
Why do LaTeX internal commands have an @ in them?
What does the @
symbol mean in LaTeX? I'm looking at the source of apa.cls
, and there's a declaration:
\newsavebox\gr@box
and later on
\sbox\gr@box{\includegraphics[width=\linewidth]{#2}}.
It seems like @
isn't acting as a normal character, but I can't figure out exactly what it's doing, and couldn't find anything after bit of googling (how I would love a Google regex feature!) Thanks.
EDIT: Thanks for the help; of the links I looked through I found http://www.tug.org/pipermail/tugindia/2002-January/000178.html to be very helpful and concise. To summarize, the @
character is not normally allowed in the names of macros, so as a hack for scoping, LaTeX packages declare it internally to be a valid name character and use it for their macros. You can use \makeatletter
in a document to access these macros, but you obviously must be very careful since you have can now overwrite essential LaTeX kernel macros; use \makeatother
to revert.
Best Answer
Every char has the category code from 0 up to 15.
\
(Unicode code point U+005C) is a default escape character.{
is a beginning-of-group character.}
as end-of-group character.$
for this.&
.#
.^
._
.a..z
,A..Z
are in this category. Often, macro packages make some ‘secret’ character (for instance@
) into a letter, see below.@
.~
has such category.%
.A macro name consists only of letters (code 11). The
@
symbol has category code 12 and can therefore not be included in the macro name. However, you can change the category of any symbolNow you can use
@
as letter in your macro names. All LaTeX packages change catcode of the@
to 11 and return it to 12 at the end.Note you can change catcode any character, not only @. For example, if you want to use
[
,]
as open and close group symbols write