TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Why do LaTeX internal commands have an @ in them?
What do \makeatletter and \makeatother do?
What is the difference between \myname and \my@name while writing a .cls file?

I have tried a few times to write/understand other peoples packages. Though I'm no good yet, I keep running into a definition using @ or @@ in the name. Why is this done ? Is there any special meaning ? Is this in any way related to the use of _ and __ in python, where a variable starting with @ shouldn't really be messed with while one with __ definitely should not be messed with ?

As an example :

\@author is used in the class files article.cls but is not defined anywhere. So I assumed the @ to mean it was some kind of command internal to LaTeX/TeX. While in a custom class file (res.cls by Michael DeCorte to be exact) I've seen \@name is specifically defined as both




To my knowledge the latter ensures a default value is set up in case the \name command is not used by the document writer. But this still doesn't indicate why the @ is used.

share|improve this question

marked as duplicate by egreg, Caramdir, Werner, Martin Scharrer May 14 '12 at 22:05

This question was marked as an exact duplicate of an existing question.

Welcome to TeX.sx! A tip: If you indent lines by 4 spaces or enclose words in backticks `, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). – Martin Scharrer May 14 '12 at 21:58
We had this question before. I'm currently looking for it. – Martin Scharrer May 14 '12 at 22:01
Maybe this answer helps? – clemens May 14 '12 at 22:02
Oh dear, I did search for @ in the search bar and didn't get a response, that's why I posted I didn't realise it was a duplicate, sorry. – Carel May 14 '12 at 22:54
@Carel: No worries. It is pretty much impossible to search for this. – Caramdir May 15 '12 at 0:25