Preparation of manuscripts for the American Journal of Physics using LaTeX

LaTeX is typesetting software that is widely used by mathematicians and physicists because it is so good at typesetting equations. It is also completely programmable, so it can be configured to produce documents with almost any desired formatting, and to automatically number equations, figures, endnotes, and so on. (Pepe 2014)

To prepare manuscripts for the American Journal of Physics (AJP), you should use the REVTeX 4.1 format for Physical Review B preprints, as indicated in the documentclass line at the top of this article’s source file. (If you’re already familiar with LaTeX and have used other LaTeX formats, please resist the temptation to use them, or to otherwise override REVTeX’s formatting conventions, in manuscripts that you prepare for AJP.)

This sample article is intended as a tutorial, template, and reference for AJP authors, illustrating most of the LaTeX and REVTeX features that authors will need. For a more comprehensive introduction to LaTeX, numerous books and online references are available.(citation not found: latexsite) (citation not found: wikibook) (citation not found: latexbook) Documentation for the REVTeX package can be found on the APS web site.(citation not found: revtex)

LaTeX is free software, available for Unix/Linux, Mac OS X, and Windows operating systems. For downloading and installation instructions, follow the links from the LaTeX web site.(citation not found: latexsite) It is most convenient(citation not found: cloudLaTeX) to install a “complete TeX distribution,” which will include LaTeX, the underlying TeX engine, macro packages such as REVTeX, a large collection of fonts, and GUI tools for editing and viewing your documents. To test your installation, try to process this sample article.

To typeset a paragraph of ordinary text, just type the text in your source file like this. Put line breaks wherever you want, and don’t worry about extra spaces between words, which LaTeX will ignore. You can almost always trust LaTeX to make your paragraphs look good, with neatly justified margins.

To start a new paragraph, just leave a blank line in your source file.

A few punctuation characters require special treatment in LaTeX. There are no “smart quotes,” so you need to use the left-quote key (at the top-left corner of the keyboard) for a left quote, and the ordinary apostrophe key (next to the semi-colon) for a right quote. Hit either key twice for double quotes, which are standard in American English. Don’t use shift-apostrophe to make double quotes. Use single quotes when they’re nested inside a double-quoted quotation. When a period or comma belongs at the end of a quotation, put it inside the quotes—even if it’s not part of what you’re quoting.(citation not found: nevermindlogic)

Your fingers also need to distinguish between a hyphen (used for multi-word adjectives and for hyphenated names like Lennard-Jones), an en-dash (formed by typing two consecutive hyphens, and used for ranges of numbers like 1–100), and an em-dash (formed out of three consecutive hyphens and used as an attention-getting punctuation symbol—preferably not too often).

Some non-alphanumeric symbols like $, &, and % have special meanings in a LaTeX source file, so if you want these symbols to appear in the output, you need to precede them with a backslash.

There are also special codes for generating the various accents that can appear in foreign-language words and names, such as Ampère and Schrödinger.(citation not found: FontEncodingComment)

You can switch to italic, bold, and typewriter fonts when necessary. Use curly braces to enclose the text that is to appear in the special font. In general, LaTeX uses curly braces to group characters together for some common transformation.

Notice that any word or symbol preceded by the backslash character is a special instruction to LaTeX, typically used to produce a special symbol or to modify the typeset output in some way. These instructions are also called control sequences or macros. After you’ve used LaTeX for a while, the little finger of your right hand will be really good at finding the backslash and curly-brace keys.

To type mathematical symbols and expressions within a paragraph, put them between $ signs, which indicate math mode: \(ab+2c/d=e-3f\). LaTeX ignores spaces in math mode, using its own algorithms to determine the right amount of space between symbols. Notice that an ordinary letter like \(x\), when used in math mode, is automatically typeset in italics. This is why you need to use math mode for all mathematical expressions (except plain numerals), even when they don’t contain any special symbols. But don’t use math mode to italicize ordinary words.

Besides ordinary letters and numerals and common arithmetic symbols, math mode provides a host of other characters that you can access via control sequences.(citation not found: wikimathpage) These include Greek letters like \(\pi\) and \(\Delta\) (note capitalization), symbols for operations and relations such as \(\cdot\), \(\times\), \(\pm\), \(\gg\), \(\leq\), \(\sim\), \(\approx\), \(\propto\), and \(\rightarrow\), and special symbols like \(\nabla\), \(\partial\), \(\infty\), and \(\hbar\). You can decorate symbols with dots (\(\dot{x}\) or \(\ddot{x}\)), arrows (\(\vec{\mu}\)), bars (\(\bar{x}\) or \(\overline{m}\)), hats (\(\hat{x}\)), tildes (\(\tilde{f}\) or \(\widetilde{w}\)), and radicals (\(\sqrt{\pi}\), \(\sqrt{2/3}\)). Parentheses and square brackets require no special keystrokes, but you can also make curly braces and angle brackets: \(\{\langle\ \cdots\ \rangle\}\).

To make subscripts and superscripts, use the underscore and caret (circumflex) symbols on your keyboard: \(x^{\mu}\), \(g_{\mu\nu}\), \(\delta^{i}_{j}\), \(\epsilon^{ijk}\). Notice that you need to put the subscript or superscript in curly braces if it’s longer than one character (or one control sequence). You can even make nested subscripts and superscripts, as in \(e^{-x^{2}}\). If a subscript consists of an entire word or word-like abbreviation, we usually put it in plain Roman type: \(x_{\textrm{max}}\). If you need to put a subscript or superscript before a symbol, use an empty set of curly braces: \({}^{235}_{\ 92}\textrm{U}\). (Notice the trick of using backslash-space put a space before the 92.)

To make boldface letters you use the `\mathbf`

control sequence, as in
\(\nabla\times\mathbf{E}=-\partial\mathbf{B}/\partial t\). For bold Greek
letters like \(\boldsymbol{\omega}\), you need to use `\boldsymbol`

instead. You can also use calligraphic (\(\mathcal{E}\)), Fraktur
(\(\mathfrak{D}\)), and blackboard bold (\(\mathbb{R}\)) fonts, if you need them.
If you’ll be using a symbol in a special font repeatedly, you can save
some keystrokes by defining an abbreviation for it; for example, the
definition `\newcommand{\bE}{\mathbf{E}}`

allows you to type simply
`\bE`

to get \(\mathbf{E}\).

Unit abbreviations, as in \(1~{}\mathrm{eV}=1.6\times 10^{-19}~{}\mathrm{J}\),
should be in the plain Roman font, not italics. You can access this font
from math mode using `\mathrm`

. For function names like \(\sin\theta\),
\(\exp x\), and \(\ln N!\), LaTeX provides special control sequences,
which you should use instead of `\mathrm`

whenever possible because
they work better with LaTeX’s automatic spacing algorithms.

But LaTeX doesn’t always get the spacing right in mathematical formulas.
In the previous paragraph we had to use the `~`

symbol to
manually insert a space between each number and its units. The `~`

symbol actually represents an unbreakable space, where LaTeX will never
insert a line break. For occasional minor adjustments to the spacing
in a LaTeX expression, you can insert or remove a little
space with `\,`

and `\!`

. Use these macros sparingly,
because LaTeX’s default spacing rules will provide more consistency
within and among AJP articles. The most common use of `\,`

is in expressions like \(T\,dS-P\,dV\).

## Share on Social Media