# Tim Evans LaTeX Tips Page

## LaTeX

Google "Useful LaTeX Guides" to find some of the many guides. I like "The Not So Short Introduction to LATEX2" by Oetiker Partl, Hyna and Schlegl (v.4.24 is dated Feb 2008). There is a also a good looking Wikibook on LaTeX. Another good place looks like the LaTeX Community web site. Some of these tips came from Andy Roberts LaTeX typesetting tutorial.

For a suggestion on how to install LaTeX under Windows see my page on Windows.

### Simple Tips

• Never leave an empty line after the end of an equation or eqnarray unless you really meant to start a new paragraph. Often such equations are to be read as being in the middle of a paragraph and an empty line indicates a new paragraph.
• Quotes in LaTeX are built from the single quotes, always use one or two single backwards quote characters  (grave accent, ASCII 96, on a funny key to the left of the number 1 on my UK keyboard) at the start of a phrase, and match with the same number of normal single quotes ' (apostrophe, ASCII code 39, with the @ symbol on my UK keyboard). Never use the single symbol for a double quote " (ASCII 34, on the key with the number 2 on my UK keyboard).
• When using letters or words as labels in superscripts or subscripts, use the \mathrm{text} to get the text in roman style. Otherwise it will appear in italic style usually used for the mathematics symbols. Thus x_{\mathrm{max}} looks better than plain x_{max}. If you use this a few times, why not define a new command e.g. \newcommand{\xmax}{x_{\mathrm{max}}} usually placed before the \begin{document}.
• For symbols to represent "much less than" and "much more than", do not use two less than signs or two greater than signs. There are special commands \ll and \gg which look much better than doing << and >>.
• To see all the labels used in equations figures, sections etc. while you are writing a document, put a
\usepackage{showkeys}
command near the top of the LaTeX file, just after the documentclass command.
• Dashes and hyphens:- one for a hyphenated-word, two for a number range 1--2, three for a punctation dash --- like this (note spaces either side of the three dashes).
• To get the name of the file used to start LaTeX use something like
\texttt{{\jobname}.tex}}
To get the names of all the constituent LaTeX files is harder.
• There are various times you might want to tweak the spacing between objects. I find threat the measure of an integral often seems to run into the integrand and I like to add a small space between them. I may want large space between text and maths inside a single equation. I have used these to create my own simple symbol by placing two others on top of each other. There are some standard symbols for spaces in LaTeXand it is useful to know some of them for minor tweaks.
• \, or \thinspace a thin space
• \: or \> or \medmuskip a medium space
• \; or \thickmuskip a thick space
• \enspace, \quad and \qquad are large spaces of increasing size, 0.5, 1.0 and 2.0 em respectively.
• \hspace{len} is the LaTeX command for arbitrary space.
• \ (a space after the backslash) is a LaTeX "control space". Use it after a full stop in the middle of a sentence to avoid the space usually added between sentences.
• \! a negative thin space of size \thinmuskip
So for example I might write
        \begin{eqnarray}
A &=& B \, , \qquad B=C
\\
I &=& \int_{0}^{1} dx \; x \cos(2 \pi x)

As soon as you want to do something more carefully or on a larger scale then use proper environments (allign) or spacing commands (\hspace).
• To break and start a new page there are two commands. The command \newpage forces a new page to start with space added to the existing page to fill it up. On the other hand \pagebreak[number] tries to break at that point by stretching the rest of the content to fill the space so there is no gap at the bottom of the page. The optional argument is a number from 0 (easy to ignore) to 4 (force break) which sets the priority for a break to be made. Note also there is \nopagebreak[number] which stops a page break.
The \clearpage command finishes the current page and prints any floats (figures etc) waiting to be output.
The are also \newline \linebreak[number] commands which do a similar job for lines.
Explanation: the .bst file format uses post-fix notation. The crucial piece is the string following the variable-name nameptr -- this string specifies the format. Leave everything else untouched. With some more "hacking", it is possible to get rid of months and to shrink pages to simply p. Check out BibTeX site for further info.

\usepackage{mathtime} is supposed to handle math with Times font better.

URLs require the ~ symbol, which can be created simply with $\sim$. This is not a real ~ but looks much better (since it is bigger).

Bibliography: Don't forget to use curly-braces in paper-titles when they are necessary! Without the braces in title = " Foo-bar for {TCP/UDP} bar-foo", the citation will be printed as "Foo-bar for tcp/udp bar-foo" (note the small-case for "TCP/IP"). Surround all acronyms and proper nouns with curly-braces and capitalise any letters you wish to retain as such.

### Two Columns

These tips came from Andy Roberts LaTeX typesetting tutorial.

Use the twocolumn option in article as \documentclass[twocolumn]{article}. It defines a multicols environment so when you want two columns use

\begin{multicols}{2}
blah blah blah
\end{multicols}

You can mix and match number of columns. If you want vertical rules change this default setting of \columnseprule from 0 (no rules) to say \setlength{\columnseprule}{1pt}. Space between columns is altered using \setlength{\columnsep}{20pt} (default 10pt). Note graphics are not fully catered for, use \begin{figure*}

### Posters

For a good poster class try baposter.

### RevTeX

The A brief and concise description of RevTeX 4 package looks like a useful source. Some useful options for RevTeX are found by googling revtex options or try these in various combinations
\documentclass[preprint,pre]{revtex4}
\documentclass[showpacs,onecolumn,amsmath,amssymb]{revtex4}
\documentclass[preprint,nofootinbib,amsmath,amssymb]{revtex4}
\documentclass[twocolumn,nofootinbib,amsmath,amssymb,preprintnumbers]{revtex4}`