Math Mode


This section will cover how to typeset mathematics. It will also cover how to handle complicated equations and multiple equation environments.

What is math mode?

For many people the most useful part of LaTeX is the ability to typeset complex mathematical formulas. for the sake of simplicity, LaTeX separates the tasks of typesetting mathematics and typesetting normal text. This is achieved by the use of two operating modes, paragraph and math mode. There is also a third mode called LR mode, however, this is rarely used by beginners and furthermore, is usually implicitly entered with other commands. It will not be covered here. Paragraph mode is the default mode for the document environment and does not need to be called explicitly.

There are a few ways to enter math mode, however the most common is $....$, where the text within the dollar signs is in the math mode environment. You have already been using math mode unknowingly by using the \begin{equation} and \end{equation} commands.

The following table lists three methods and their usage of declaring math mode.

Method Special Characteristics Usage
$....$ None In-line math
\begin{equation} \end{equation} Goes to a newline and center equation with label Equations
\[ ....\] Goes to a newline and center equation Equations with no label

There are equivalent ways of entering math mode for each of these methods, for example, $$....$$ is equivalent to \[ ....\], however, the latter is now strongly preferred. I almost always use the first two methods for typesetting basic math.

Now try the following LaTeX code.

	\int_\alpha^\beta f'(x) \, dx=f(\beta)-f(\alpha).
We can use the fundamental theorem of calculus to say that
 $\int_2^3 x^2 \, dx=\frac{3^3}{3}-\frac{2^3}{3}=\frac{19}{3}$.  
Also note that $\displaystyle \int_2^3 x^2 \, dx=\frac{3^3}{3}-\frac{2^3}{3}=\frac{19}{3}$. 
 We can also give this equation its own line 
	\int_2^3 x^2 \, dx=\frac{3^3}{3}-\frac{2^3}{3}=\frac{19}{3}.

View PDF ››

It appears you don't have a PDF plugin for this browser. You can click here to download the PDF file.


Note that math mode ignores whitespace, in fact, this whole code could have been put on one line and still would have compiled correctly. Another thing to notice is the effect of the \displaystyle command. This command forces LaTeX to give an equation the full height it needs to display as if it were on its own line. Be careful in using it as it can make a document due to variable line height.

Multiple Equations

There are several ways to format multiple equations and the amsmath package adds several more. In general, the command \\ signifies a line break and within the correct math mode environment, it can start a new equation line. Try the example on the right which sets the same multiple equations in several ways.

View PDF ››

It appears you don't have a PDF plugin for this browser. You can click here to download the PDF file.

	\geq x^2
	\geq x^2
	&\geq x^2

Observe that the equation environment does not even allow line breaks. this is not the proper environment for multiple equations if we wish to have them formatted on separate lines.

The gather and align environments both give us the result we want, albeit in slightly different manners.

Note: The \notag command tells LaTeX not to number that specific line.

The following is a table of some of the most common LaTeX mathematical symbols.

Symbol Name LaTeX Command Rendering Notes
In-line Fraction
dFRAC Similar to \displaystyle with \frac
Greek Letters
\alpha \beta \gamma
Greek Letters
\int_a^b \iint \oint
Integral Second set have \displaystyle
Properly sized parentheses
Paren Will automatically size
sum Second set have \displaystyle
← Back
Table of Contents
Next →

Created by Zachary Glassman. Contact at