Understanding Math Mode: The Foundation
Before we dive into specific symbols, it is crucial to understand that LaTeX treats mathematical symbols differently than regular text. To use Greek letters or math symbols, you must enter Math Mode.
There are two primary types of math mode:
- Inline Math Mode: Used for symbols within a sentence. You wrap the code in single dollar signs, like this:
$x + y$. - Display Math Mode: Used for equations that sit on their own line, centered. You wrap the code in double dollar signs
$$ ... $$or use the\[ ... \]environment.
Note: Most of the symbols discussed in this guide will produce an error if you try to use them outside of math mode. If you see an error like "Missing $ inserted," it usually means you forgot to enter math mode.
Greek Letters
Greek letters are essential in mathematics, physics, and engineering. In LaTeX, producing them is intuitive: you simply type a backslash followed by the name of the letter.
Lowercase Greek Letters
Lowercase letters are almost always written out in full.
| Symbol | LaTeX Command | Symbol | LaTeX Command |
|---|---|---|---|
| $\alpha$ | \alpha | $\beta$ | \beta |
| $\gamma$ | \gamma | $\delta$ | \delta |
| $\epsilon$ | \epsilon | $\zeta$ | \zeta |
| $\pi$ | \pi | $\omega$ | \omega |
Uppercase Greek Letters
To get the uppercase version of a Greek letter, simply capitalize the first letter of the command name. Note that some uppercase Greek letters (like Alpha or Beta) look identical to Latin letters ($A$, $B$), so LaTeX does not provide specific commands for them; you just use the standard keyboard letter.
| Symbol | LaTeX Command |
|---|---|
| $\Gamma$ | \Gamma |
| $\Delta$ | \Delta |
| $\Theta$ | \Theta |
| $\Omega$ | \Omega |
Variant Forms
Some Greek letters have "variant" forms which are commonly used in specific contexts (like $\phi$ vs $\varphi$).
The standard epsilon is $\epsilon$, but the variant is $\varepsilon$.
The standard phi is $\phi$, but the variant is $\varphi$.
The standard rho is $\rho$, but the variant is $\varrho$.Binary Operators and Relations
Binary operators (things that go between two numbers) and relations (things that compare two values) are the "verbs" of your equations.
Common Operators
While + and - work directly from your keyboard, others require specific commands:
- Multiplication: Use
\times($\times$) or\cdot($\cdot$). Never use the letter 'x'. - Division: Use
\div($\div$). - Plus-Minus: Use
\pm($\pm$).
Common Relations
Relations help define the equality or inequality between expressions:
- Not equal:
\neq($\neq$) - Less than or equal:
\leor\leq($\le$) - Greater than or equal:
\geor\geq($\ge$) - Approximately:
\approx($\approx$) - Proportional to:
\propto($\propto$)
Example Code:
\[
a^2 + b^2 = c^2 \quad \text{and} \quad x \approx 3.14
\]
\[
A \cap B \neq \emptyset \implies x \in A \cup B
\]Large Operators: Sums and Integrals
Large operators are symbols that often take "limits" (subscripts and superscripts). LaTeX automatically adjusts the size and placement of these limits depending on whether you are in inline or display math mode.
Sums and Products
- Summation:
\sum - Product:
\prod
Integrals
- Integral:
\int - Double Integral:
\iint - Contour Integral:
\oint
Using Limits
To add limits to these operators, use the underscore _ for the bottom and the caret ^ for the top.
% Example of a summation and an integral
The sum is defined as $\sum_{i=1}^{n} i$.
In display mode, it looks like this:
\[
\int_{a}^{b} f(x) \, dx = F(b) - F(a)
\]Best Practice: When writing integrals, add a small space before the "dx" using the
\,command. This makes the equation much more readable and professional.
Math Accents and Dots
Often, you need to place a symbol over a letter to indicate a vector, a mean, or a derivative.
Common Accents
- Vector:
\vec{a}($\vec{a}$) - Bar/Mean:
\bar{x}($\bar{x}$) - Hat/Unit Vector:
\hat{i}($\hat{i}$) - Dot/Derivative:
\dot{a}($\dot{a}$) or\ddot{a}($\ddot{a}$)
Ellipses (Dots)
Do not just type three periods (...). LaTeX provides specific commands to ensure the spacing is correct.
- Low dots:
\dots(for lists: $1, 2, \dots, n$) - Centered dots:
\cdots(for multiplication: $x_1 \cdot x_2 \cdots x_n$) - Vertical dots:
\vdots(commonly used in matrices)
Example Code:
Let the vector be $\vec{v} = (v_1, v_2, \dots, v_n)$.
The average value is denoted by $\bar{x}$.
The second derivative of position is acceleration: $\ddot{s}(t) = a$.Best Practices and Common Pitfalls
To create clean, professional-looking documents, keep these tips in mind:
- Use the
amsmathPackage: Always include\usepackage{amsmath}in your preamble. It improves the look of many symbols and provides better environments for multi-line equations. - Don't Use Text for Symbols: Avoid using the letter 'x' for multiplication. Use
\timesor\cdot. Similarly, don't use the pipe|on your keyboard for "such that" in sets; use\midfor better spacing. - Group Complex Superscripts: If your superscript or subscript contains more than one character, wrap it in curly braces
{}. For example,$e^{i\pi}$is correct, but$e^i\pi$will result in $e^{i} \pi$. - Case Sensitivity: Remember that
\deltaand\Deltaare different symbols. Double-check your capitalization if you get a "command undefined" error. - Whitespace: LaTeX ignores extra spaces in math mode.
$x+y$and$x + y$produce the same result. Use spaces in your code to make it readable for yourself.
Final Practical Example
Here is how you might combine several of these concepts in a real document:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
The area of a circle with radius $r$ is given by:
\[
A = \pi r^2
\]
The Gaussian integral is a famous result in calculus:
\[
\int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}
\]
We can also define the relationship between the sum and the average:
\[
\bar{X} = \frac{1}{n} \sum_{i=1}^{n} X_i
\]
Finally, consider the limit of the sequence $\epsilon_n$ as $n \to \infty$:
\[
\forall \varepsilon > 0, \exists N \in \mathbb{N} \text{ s.t. } n > N \implies |x_n - L| < \varepsilon
\]
\end{document}By mastering these symbols and the logic behind math mode, you have the tools to typeset almost any mathematical expression clearly and accurately.
