Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

what do makeatletter and makeatother do ?

719 views
Skip to first unread message

Gregory Van Vooren

unread,
Apr 20, 1999, 3:00:00 AM4/20/99
to
I used LyX to typeset my documents until recently, and found
"makeatletter" and "makeatother" inserted in the header of the LaTeX file.
I searched both in several books but haven't found what they do. Can
anybody explain their use ?
Thanks in advance.
Friendly regards,

Greg.
--
---------------------------------------------------------------
Of all the things I lost, | Gregory....@advalvas.be
I miss my mind the most. | http://studwww.rug.ac.be/~gvanvoor/
(Steven Tyler ,Aerosmith) |
---------------------------------------------------------------


Robin Fairbairns

unread,
Apr 20, 1999, 3:00:00 AM4/20/99
to
Gregory Van Vooren <gvan...@eduserv2.rug.ac.be> wrote:
>I used LyX to typeset my documents until recently, and found
>"makeatletter" and "makeatother" inserted in the header of the LaTeX file.
>I searched both in several books but haven't found what they do. Can
>anybody explain their use ?

\makeatletter twiddles the catcode of `@' so that it can be used as
part of command names. this eases access to latex internal commands.

\makeatother reverses that change.
--
Robin Fairbairns, Cambridge

ma...@csv.warwick.ac.uk

unread,
Apr 20, 1999, 3:00:00 AM4/20/99
to
In article <7fhhc1$cob$1...@inf6serv.rug.ac.be>,

gvan...@eduserv2.rug.ac.be (Gregory Van Vooren) wrote:
> I used LyX to typeset my documents until recently, and found
> "makeatletter" and "makeatother" inserted in the header of the LaTeX file.
> I searched both in several books but haven't found what they do. Can
> anybody explain their use ?

Every character you type is put into one of 15 categories by TeX. The
category of a character determines how TeX treats the character. For example
one category is `letters' another is `other symbols'. When you type a command
like \em TeX reads the `letters' following the backslash, in this case `em'.
Because `@' is not a letter TeX will interpret \two@digits as a command
sequence `two' the symbol `@' followed by the six letters d,i,g,i,t,s.

The at symbol `@' is initally in the `other' category, \makeatletter makes it
a `letter' this means that commands like \@addtoreset can be defined and
used. The command \two@digits will be interpreted as the command
`two@digits'. You might see some commands with @ in their names in the
preamble.

All of the internal commands of LaTeX have an @ in their names. This means
that they are inaccessible unless one first types \makeatletter. This is to
prevent users accidentally breaking some part of the LaTeX kernel by
redefining interal commands.

The \makeatletter allows a user to use the internal commands of LaTeX.
\makeatother puts things back to normal. These commands are not needed in
style files as there @ is normally a letter.

James

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Frank Boehme

unread,
Apr 20, 1999, 3:00:00 AM4/20/99
to Gregory Van Vooren
Gregory Van Vooren wrote:
>
> I used LyX to typeset my documents until recently, and found
> "makeatletter" and "makeatother" inserted in the header of the LaTeX file.
> I searched both in several books but haven't found what they do. Can
> anybody explain their use ?
> Thanks in advance.
> Friendly regards,


Hi Greg,

In TeX, all characters have a 'category code' which denotes what these
characters are supposed to be, for instance 'letter' or 'other character'.
Commands like \whatever must not contain 'other characters' such as
@ (at). This is done in order to avoid clutter with low level
commands, such as \@ne \tw@ and so on. However, you can overwrite
this behaviour by saying that 'at' is to be seen as a 'letter'
(\makeatletter). This is often done in style files. Switching back to
default behaviour is done by \makeatother.

Happy TeXing,

Frank

--
Dr Frank Boehme | Email: f.bo...@cs.ucc.ie
National University of Ireland, Cork | phone: +353-21-903163
Dept of Computer Science | fax: +353-21-903113
Cork, Ireland | WWW: http://yeats.ucc.ie/~fboehme/

0 new messages