summaryrefslogtreecommitdiff
path: root/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-atsigns.html
blob: 732a14f49ea254f44f7bbb5d0323ef3f23fe2f69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<head>
<title>UK TeX FAQ -- question label atsigns</title>
</head><body>
<h3><code>\</code><code>@</code> and <code>@</code> in macro names</h3>
<p>Macro names containing <code>@</code> are <em>internal</em> to LaTeX, and
without special treatment just don't work in ordinary use.  An
exemplar of the problems caused is discussed in 
"<a href="FAQ-atvert.html"><code>\</code><code>@</code> in vertical mode</a>".
<p>The problems users see are caused by copying bits of a class (<code>.cls</code> file) or
package (<code>.sty</code> file) into a document, or by including a class or
package file into a LaTeX document by some means other than
<code>\</code><code>documentclass</code> or <code>\</code><code>usepackage</code>.  LaTeX defines internal
commands whose names contain the character <code>@</code> to
avoid clashes between its internal names and names that we would
normally use in our documents.  In order that these commands may work
at all, <code>\</code><code>documentclass</code> and <code>\</code><code>usepackage</code> play around with the
meaning of <code>@</code>.
<p>If you've included a file wrongly, you solve the problem by using the
correct command.
<p>If you're using a fragment of a package or class, you may well feel
confused: books such as <a href="FAQ-books.html"><em>The LaTeX Companion</em></a>
are full of fragments of packages as examples for you to employ.
<p>For example, there's a lengthy section in <em>The Companion</em> about
<code>\</code><code>@startsection</code> and how to use it to control the appearance of
section titles.  Page 15 discusses the problem; and
suggests that you make such changes in the document preamble, between
<code>\</code><code>makeatletter</code> and <code>\</code><code>makeatother</code>.  So the redefinition of
<code>\</code><code>subsection</code> on page 26 could be:
<blockquote>
<pre>
\makeatletter
\renewcommand{\subsection}{\@startsection
  {subsection}%                    % name
  ...
  {\normalfont\normalsize\itshape}}% style
\makeatother
</pre>
</blockquote>
<p>The alternative is to treat all these fragments as a package proper,
bundling them up into a <code>.sty</code> file and including them with
<code>\</code><code>usepackage</code>.  (This approach is marginally preferable, from the
LaTeX purist's point of view.)
<p><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=atsigns">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=atsigns</a>
</body>