Things to do and not do when preparing your LaTeX contribution

\label{app:donotdo}

Authors accumulate over time a certain experience and habits for preparing their scientific documents electronically using their preferred text editor and document processing system. When submitting a LaTeX source file to an editor for publication, it is very important that the source of the contribution be readable and understandable to the various people who have to intervene in the production process.

Make your source easy to read and maintain

In order to make life easier for yourself as well as for the professionals who will have to deal with your source file, we invite authors to take into account the following general suggestions.

  • Use, as far as possible, only basic LaTeX commands, including those of the packages that are loaded by the cernrep.cls. In particular, for graphics inclusion, use the \includegraphics command rather than its deprecated precursors (\epsffile, \epsfig, etc.). For math expressions, see Section 1.2.

  • Do not use TeX commands, but their LaTeX equivalents. In particular, \def should never be used to (re)define commands, since there exists \newcommand, or \providecommand, which will issue an error message if the command name is already in use. Basic LaTeX commands or environment should never be redefined.

  • Do not use $$ for delimiting a display math formula, but use the LaTeX construct \[\], instead. More generally, numbered equations can be produced with the equation environment, with equation* its unnumbered variant.

  • Do not use one-letter (or even two-letter) lower-case commands as command definitions, since TeX, LaTeX, or some extension packages define these already. Indeed, many hours have been lost, to understand that the redefinition of, for instance, \r on one of the several thousands of lines of a LaTeX source of an author upset the typesetting several pages downstream. In general, it is good practice to define new commands starting with an upper-case letter and giving it a name with a mnemonic meaning, i.e., one which is three or more characters long.

  • Do not replace LaTeX environments by commands, e.g., \be, \ee, and \bee and \eee for delimiting the equation and eqnarray environments, \bi, \ei, to delimit the itemize environment, etc. Saving a few keystrokes can be no excuse for obfuscating the source unnecessarily, thus making it more difficult to understand and maintain. Authors spend, in general, many weeks, preparing an article or a report. Hence it is certainly worth while to use, as far as possible, standard LaTeX commands, and to define new ones only to make the source easier to read and re-use.

  • Do not use TeX’s state changing font commands {\rm ...} , {\it ...} , {\bf ...} , etc., but use the LaTeX equivalents: in text mode \textrm{...} , \emph{...} , \textbf{...} , and inside math mode, \mathrm{...} , \mathit{...} , \mathbf{...} , etc.

  • Do not reference equations, sectioning commands, figures, or tables by explicit, hard-coded numbers in your source, but use LaTeX’s cross-reference mechanism, using a mnemonic key to identify each structural element clearly (see Section LABEL:sec:crossref).

  • Do not redefine LaTeX’s basic counters, such as equation, section, etc. Numbering of such elements is defined by the cernrep class file and should not be modified by the authors, who should use only LaTeX’s cross-reference mechanism to refer to equations, figures, tables, etc. (see Section LABEL:sec:crossref).

The amsmath extensions

\label{app:amsmath}

Recent developments around LaTeX, often sponsored and driven by scientific publishers, have ensured that structural elements and math constructs in particular are easily delimited and their sense made clear. The American Mathematical Society have done a great job with their amsmath extension, which is loaded by default in the cernrep.cls class. Therefore, we would like our authors to use the conventions and LaTeX constructs of that package, rather than the pure TeX primitives. This is all the more important as we want to take full advantage of the possibilities of hypertext and the Web, where TeX primitives, because they are not clearly delimited, are much more difficult to handle (see previous paragraph).

Below we give a few often-occurring mathematics constructs, first in their TeX form (to be avoided), their LaTeX equivalent (to be preferred), and the typeset result.

  • \over to be replaced by \frac.

    TeX

    ${Z^\nu_{i}\over 2 \Lambda_{\rm ext}}$

    LaTeX

    $\frac{Z^\nu_{i}}{2 \Lambda_{\text{ext}}}$

    Result

    \(\displaystyle\frac{Z^{\nu}_{i}}{2\Lambda_{\text{ext}}}\)

  • \choose to be replaced by \binom.

    TeX

    ${m + k \ choose k}$

    LaTeX

    $\binom{m + k}{k}$

    Result

    \(\binom{m+k}{k}\)

  • \matrix family to be replaced by corresponding environments.

    TeX

    $\matrix{a & b \cr c & d\cr}$

    LaTeX

    $\begin{matrix}a & b\\c & d\end{matrix}$

    Result

    \(\begin{matrix}a&b\\ c&d\end{matrix}\)

    TeX

    $\pmatrix{a & b \cr c & d\cr}$

    LaTeX

    $\begin{pmatrix}a & b\\c & d\end{pmatrix}$

    Result

    \(\begin{pmatrix}a&b\\ c&d\end{pmatrix}\)

    TeX

    $\bmatrix{a & b \cr c & d\cr}$

    LaTeX

    $\begin{bmatrix}a & b\\c & d\end{bmatrix}$

    Result

    \(\begin{bmatrix}a&b\\ c&d\end{bmatrix}\)

  • Cases construct: use the cases environment.

    LaTeX without amsmath

    $$ {\rm curvature~} R = {6K\over a^2(t)} \quad \left\{\begin{array}{ll} K=-1\quad&{\rm open}\\ K=0 &{\rm flat}\\ K=+1 &{\rm closed} \end{array}\right. $$

    LaTeX with amsmath

    \[ \text{curvature } R = \frac{6K}{a^2(t)} \quad \begin{cases} K=-1\quad&\text{open}\\ K=0 &\text{flat}\\ K=+1 &\text{closed} \end{cases} \]

    Result
    \begin{multline} \text{curvature }R=\frac{6K}{a^{2}(t)}\quad\begin{cases}K=-1&\text{open}\\ K=0&\text{flat}\\ K=+1&\text{closed}\end{cases} \end{multline}
  • amsmath offers symbols for multiple integrals.

    TeX

    $\int\!\!\int\!\!\int {\rm div}~\vec{\rm E}\,{\rm d}V
    = \int\!\!\int\vec{\rm E}\,{\rm d}\vec{\rm S}$

    LaTeX

    $\iiint \text{div}~\vec{\mathrm{E}}\,\mathrm{d}V
    = \iint\vec{\mathrm{E}}\,\mathrm{d}\vec{\mathrm{S}}$

    Result

    \(\iiint\text{div}~{}\vec{\mathrm{E}}\,\mathrm{d}V=\iint\vec{\mathrm{E}}\,\mathrm{d}\vec{\mathrm{S}}\)

The cernrep class loads, amongst others, the amsmath and the amssymb packages. The latter package defines many supplementary commands and symbols that with TeX would have to be constructed from more basic components. See \cite{bib:voss2005} and \cite{bib:pakin2003}, or Chapter 8 of \cite{bib:mittelbach2004} for more details.