LaTeX gives almost infinite control over formatting, and it is possible to spend hours making small adjustments to a document, forcing every character and every pixel to be in an optimal location.

A much easier solution is to **trust LaTeX** to format documents. Though it might not look exactly as you might envision, LaTeX’s standard document classes do a surprisingly good job at formatting. Of course, some manual adjustments might still be in order; you might want to change the default indent size (e.g. with `\parindent=0in`), force some space between paragraph breaks (e.g. with `\parskip=5px`), or change the margins (e.g. with the `geometry` package or using `\usepackage{fullpage}`). The general structure of a document, however, is best left up to LaTeX’s default styles.

LaTeX can fairly easily create a title heading. Here is an example:

` \title{All of Mathematics}`

\email{someone@somewhere.com}

\author{C.F. Gauss}

\date{\today}

\begin{abstract}

This paper explains all of mathematics, in alphabetical order.

\end{abstract}

\maketitle

The final `\maketitle` command tells LaTeX to display the title, author, email, date, and abstract information in the style defined by your documentclass.

LaTeX can also handle **section headings** and section numbering. To start a new section, simply say `\section{My new section}`. Similarly, you can define new subsections and subsubsections with `\subsection{My subsection}` and `\subsubsection{A subsubsection}`. These sections (and subsections and subsubsections) are automatically numbered sequentially. (To disable automatic numbering in LaTeX, add an asterisk, i.e. `\section*{Unnumbered section}`.)

LaTeX is also often used with mathematical expressions, for which there are also some stylistic points to keep in mind. Firstly, it is a good idea to **use displayed equations**. These can be used for long or complicated expressions to make them easier to read. When surrounded by text, they also serve to break up long paragraphs into more manageable chunks. Even simple equations can be displayed to make them stand out, such as

Something to keep in mind is that all punctuation following a displayed equation should be placed in math mode, immediately following the equation.

Make it a habit to **use math mode for all mathematical symbols**, regardless of length. For example, it looks ugly to say “Consider a function f with “; instead, say “Consider a function with “. Doing this allows you to clearly differentiate between math symbols and text, and also eliminates confusion resulting from math mode letters looking different from text mode letters.

LaTeX also provides a number of **math operators** for easy formatting. For example, looks ugly, while looks much better. It is easy to define new operators as well. For example, if you want to use “disc” to denote a discriminant, then you can use `\def\disc{\operatorname{disc}}` or `\DeclareMathOperator{\disc}{disc}` to define the `\disc` operator. This allows you to type `\disc K` to get .

You can also use **expanding delimiters** in large math expressions. For example, compare

The symbol on the right is achieved by writing `$P\left(\frac{1}{x}\right)$`. All other delimiters expand as well, via commands like `\left[`, `\left\{`, `\left|`.

For clarity, **inline fractions in text can be typeset horizontally**. That is, in a typical font size, the fraction is easier to read than the fraction . Of course, there are plenty of cases when you want to write fractions vertically, such as when they are part of a larger expression (e.g. ).

**Long equations can be broken up**. It’s no good when an equation is too long and runs off the page, and it’s ugly to see an equation reach into the margin. Instead, break the equation up at binary operators and equals signs, such as `+` or `=`. Long calculations can be broken up at each equals sign, such as

Similarly, it is a good idea to **align lists of equations** at equal signs, such as

Such an effect can be achieved using a construction like

`\begin{align*}`

\sin\theta &= y \\

\cos\theta &= x \\

\tan\theta &= \frac yx.

\end{align*}

**Integrals need extra space**. Compare:

The second integral separates the from the integrand, making the equation more clear. This was typeset using `$\int x^2 \, dx$`, where the `\,` serves to add a bit of space.

## Recent Comments