# LaTeX:LaTeX on AoPS

 LaTeX About - Getting Started - Diagrams - Symbols - Downloads - Basics - Math - Examples - Pictures - Layout - Commands - Packages - Help

This article explains how to use LaTeX in the AoPSWiki, the AoPS Community, and the AoPS Classroom. See Packages to know which packages are prebuilt into the AoPS site.

## Getting Started with LaTeX

### The Very Basics

LaTeX uses a special "math mode" to display mathematics. There are two types of this "math mode":

#### Lists

To make a list, such as a sequence, we use \dots. For example, $a_0,a_1,\dots,a_n$ will give us $a_0,a_1,\dots,a_n.$

#### Sums

There are two basic ways to write out sums. First, we can use + and \cdots. An example of this way would be $a_1+a_2+\cdots+a_n$ This will give us $a_1+a_2+\cdots+a_n.$ Second, we could use summation notation, or \sum. Such an example is $\sum_{i=0}^n a_i$, giving $\textstyle \sum_{i=0}^n a_i.$ Note the use of superscripts and subscripts to obtain the summation index.

#### Products

Again, there are two basic ways to display products. First, we can use \cdot and \cdots. An example is $n! = n\cdot(n-1)\cdots 2\cdot 1$, which of course gives $n! = n\cdot(n-1)\cdots 2 \cdot 1.$ The alternative is to use product notation with \prod. For instance, $n! = \prod_{k=1}^n k$, giving $\textstyle n! = \prod_{k=1}^n k.$

### Equalities and Inequalities

#### Inequalities

the commands >, <, \geq, \leq, and \neq give us $>,$ $<,$ $\geq,$ $\leq,$ and $\neq,$ respectively.

#### Aligning Equations

To align multiple equations, we use the align* environment. For example, we might type a system of equations as follows:

\begin{align*}
ax + by &= 1 \\
cx + dy &= 2 \\
ex + fy &= 3.
\end{align*}


(You do not need dollar signs.) The & symbol tells $\LaTeX$ where to align to and the \\ symbols break to the next line. This code will output \begin{align*} ax + by &= 1 \\ cx + dy &= 2 \\ ex + fy &= 3. \end{align*} An example of a string of equations is:

\begin{align*}
((2x+3)^3)' &= 3(2x+3)^2 \cdot (2x+3)' \\
&= 3(2x+3)^2 \cdot 2 \\
&= 6(2x+3)^2.
\end{align*}


Again, the & symbol tells $\LaTeX$ where to align to, and the \\ symbols break to the next line. This code outputs \begin{align*} ((2x+3)^3)' &= 3(2x+3)^2 \cdot (2x+3)' \\ &= 3(2x+3)^2 \cdot 2 \\ &= 6(2x+3)^2. \end{align*}

#### Numbering Equations

To number equations, we use the align environment. This is the same environment as the align* environment, but we leave the * off. The * suppresses numbering. To number one equation, the code

\begin{align}
ax + by = c
\end{align}


will produce \begin{align} ax + by = c. \end{align} We don't have to use & or \\ since there is nothing to align and no lines to break. To number several equations, such as a system, the code

\begin{align}
ax + by &= c \\
dx + ey &= f \\
gx + hy &= i
\end{align}


will produce \begin{align} ax + by &= c \\ dx + ey &= f \\ gx + hy &= i. \end{align} In general, align will auto-number your equations from first to last.

Again, we use the align* environment. The code

\begin{align*}
ax + by &= c & \text{because blah} \\
dx + ey &= f & \text{by such-and-such}
\end{align*}


will produce \begin{align*} ax + by &= c & \text{because blah} \\ dx + ey &= f & \text{by such-and-such}. \end{align*} (You can use align to get numbering and comments!)

#### Definition by Cases

To define, say, a function by cases, we use the cases environment. The code

$$\delta(i,j) = \begin{cases} 0 & \text{if } i \neq j \\ 1 &\text{if } i = j \end{cases}$$


gives us $$\delta(i,j) = \begin{cases} 0 & \text{if } i \neq j \\ 1 &\text{if } i = j. \end{cases}$$ As usual, the & is for aligning and the \\ is for line-breaking.

### Commonly Used Commands

#### Algebra

• Approximate: x\approx 1.5 gives us $x\approx 1.5.$

#### Geometry/Trig

• Degrees Symbol: 90^\circ gives $90^\circ.$

• Triangle Symbol: \triangle ABC gives $\triangle ABC.$

• Parallel Symbol: AB\parallel XY gives $AB\parallel XY.$

• Perpendicular Symbol: AB\perp CD gives $AB\perp CD.$

• Trig Functions: \sin\theta, \cos\theta, \tan\theta, \sec\theta, and \csc\theta give $\sin\theta,$ $\cos\theta,$ $\tan\theta,$ $\sec\theta,$ and $\csc\theta.$

• Inverse Trig Functions: \arcsin\theta, \arccos\theta, and \arctan\theta give $\arcsin\theta,$ $\arccos\theta,$ and $\arctan\theta.$

#### Sets

• Denoting Membership: a\in A gives $a\in A.$

• Complement of Set: A\setminus B yields $A\setminus B.$

• Basic Set Notation: \{...\} gives $\{...\}.$

• Set-Builder Notation: \{x\in\mathbb{R}\mid P(x)\} gives $\{x\in\mathbb R \mid P(x)\}.$

• Basic Union and Intersection: A\cup B and A\cap B give $A\cup B$ and $A\cap B.$

• Indexed Union and Intersection: \bigcup_{i=1}^n A_i and \bigcap_{i=1}^n A_i give $\bigcup_{i=1}^n A_i$ and $\bigcap_{i=1}^n A_i.$ Mostly used in display math mode.

• Subset: A \subseteq B gives $A\subseteq B.$

• Cartesian Product: A \times B gives $A\times B.$

• Common Sets: \mathbb{N}, \mathbb{Z}, \mathbb{Q}, \mathbb{R}, and \mathbb{C} give us $\mathbb N,$ $\mathbb Z,$ $\mathbb Q,$ $\mathbb R,$ and $\mathbb C.$

• Cardinality of a Set: |A| gives $|A|.$

#### Logic

• Implication: A\implies B gives $A\implies B.$

• Biconditional: A\iff B yields $A\iff B.$

• And/Or: A\land B and A\lor B give $A\land B$ and $A\lor B.$

• Negation: \neg A gives $\neg A.$