## LaTeX forum ⇒ General ⇒ Makeatletter and makeatother

LaTeX specific issues not fitting into one of the other forums of this category.
Lucia
Posts: 36
Joined: Wed Dec 31, 2008 9:03 pm

### Makeatletter and makeatother

Hello, everybody!

This might seem a very generic question to ask, but I need some help in order to understand what \makeatletter and \makeatother means. From what I read, I guess it should be used only in the preamble, when we need to change specific parameters of class files (.cls). And because we can't change these class files, we should use the piece of code whose behaviour we need changed, between \makeatletter and \makeatother. I also understood that using \makeatletter and \makeatother can be a kind of replacement for some packages. How do I know in which circumstances I should use those commands? Is there any guide you could recommend me to read? Any article on the internet? I haven't found information clear enough for me, about these commands. They seem a little confusing... I have “The LaTeX Companion”, I read it several times and I don’t get much information about this in that book. I’m sorry for such a generic question. I also don’t have a MWE to provide, I’m sorry… But I wanted to understand this; I’m guessing these are very useful commands and I might need them later, when fine-tuning my LaTeX file.

Thank you so much,
Lucia

LaTeXguide.org • LaTeX-Cookbook.net

localghost
Site Moderator
Posts: 9203
Joined: Fri Feb 02, 2007 12:06 pm

### Makeatletter and makeatother

The \makeatletter command temporarily defines »@« as a normal character to enable changes to internal LaTeX macros outside packages (STY) or classes (CLS). With \makeatother this process is reversed and the »@« is set to its original character category (other). The »@« is used to protect the internal LaTeX macros. Hence you should be very careful when using these two commands.

Best regards
Thorsten¹
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

### Makeatletter and makeatother

Lucia wrote:How do I know in which circumstances I should use those commands? Is there any guide you could recommend me to read? Any article on the internet?

There are a couple of sections on internal commands in the FAQ: \@ and @ in macro names and \spacefactor complaints.

There's also a brief mention on internal commands in my LaTeX tutorial in the section on commands.

I think there tends not to be much mention of \makeatletter and \makeatother in documentation as it's better to discourage people from using internal commands in their document.

Regards
Nicola Talbot

Lucia
Posts: 36
Joined: Wed Dec 31, 2008 9:03 pm

### Re: Makeatletter and makeatother

Thank you, localghost and Nicola, for your explanations. The links provided helped me to understand a little more about these commands. However, I still have so much to learn regarding LaTeX, before trying to use \makeatletter and \makeatother.

Thanks again,
Lucia

Stefan Kottwitz
Posts: 9804
Joined: Mon Mar 10, 2008 9:44 pm

### Makeatletter and makeatother

Hi Lucia,

here's another good explanation on the TUGlist.

Stefan

Lucia
Posts: 36
Joined: Wed Dec 31, 2008 9:03 pm

### Re: Makeatletter and makeatother

Hi Stefan.

Indeed, another good explanation.

Thank you so much,
Lucia