What does the symbol @ mean in latex
for example
\def\if@nch@mpty#1{\def\temp@a{#1}\ifx\temp@a\@empty}
\def\f@nch@def#1#2{\if@nch@mpty{#2}\f@nch@gbl\def#1{\leavevmode}\else
\f@nch@gbl\def#1{#2\strut}\fi}
What does the symbol @ mean in latex
In the normal mode, a command (or you can name it as a marco
) can be only named
by [a-zA-Z] but without others such as sign @
.
But why? Because echo character has its catcode, and only [a-zA-Z] can have the
catcode that make word as a command (or marco
). But it is amazing that TeX
suppose that you can change the characters' catcode! So at the beginning of
cls/ sty files, LaTeX sets the sign @
in marco
catcode. At the ending it
resets.
LaTeX support two commands \makeatletter
and \makeatother
does set and reset the sign @
easily.
For example:
\makeatletter
% This is ok define new command with at character.
\def\command@with@at@character{%
Command With At Character.%
}
% And you can use it in the pair makeatletter/makeatother
\command@with@at@character
\makeatother
% But you CANNOT use the macro here!!! TeX will try to call \command
% but not \command@with@at@character, because `@` now does not have
% right catcode.
% \command@with@at@character
Chilk to what-do-makeatletter-and-makeatother-do to get more information.
About the macro \catcode
(which can help you to change the character's catcode), you can get more infomation from here.
(If this answer is in wrong English syntax, please tell me or edit it. Thanks)