Mathematical Expressions
Document Structure
LaTeX Math Mode Basics
LaTeX's math mode is a powerful feature for typesetting mathematical expressions. This guide covers the fundamentals of using math mode, including both inline and display mathematics.
Types of Math Mode
LaTeX provides two main types of math mode:
Inline Math Mode
For mathematical expressions that are part of a text paragraph. Delimited by either
$...$
or\(...\)
:Display Math Mode
For standalone equations. Delimited by
$$...$$
,\[...\]
, or the equation environment:\egin{equation}x = \rac{-b \pm \sqrt{b^2 - 4ac}}{2a}\end{equation}
Basic Mathematical Notation
Type | LaTeX Code | Result |
---|---|---|
Fractions | \frac{a}{b} | |
Exponents | x^2 | |
Subscripts | x_i | |
Square Root | \sqrt{x} |
Equation Environments
LaTeX provides several environments for displaying equations:
equation Environment
For numbered equations:
\egin{equation}E = mc^2\end{equation}
equation* Environment
For unnumbered equations:
\egin{equation*}F = ma\end{equation*}
align Environment
For multiple aligned equations:
\egin{align*}x &= 3 + 2 \\y &= 3x + 1 \\z &= x + y\end{align*}
Common Math Operators
LaTeX provides predefined commands for common mathematical operators:
Operator | LaTeX Code | Result |
---|---|---|
Sum | \sum_{i=1}^n | |
Product | \prod_{i=1}^n | |
Integral | \int_{a}^b | |
Limit | \lim_{x \to \infty} |
Best Practices
- Use
\(...\)
instead of$...$
for better error detection - Use display math mode for complex equations that might be hard to read inline
- Use the amsmath package for advanced mathematical typesetting
- Always use proper spacing commands (
\,
,\;
,\quad
) for better readability - Use the align environment for equations that need alignment
Common Mistakes to Avoid
- Don't use math mode for units - use the siunitx package instead
- Avoid using
eqnarray
environment (it's obsolete) - usealign
instead - Don't forget to load required packages (amsmath, amssymb) in the preamble
- Avoid mixing text and math mode unnecessarily
Pro Tip: For more complex mathematical typesetting, check out the "Mathematical Expressions" section in the navigation, which covers advanced topics like matrices, symbols, and equation arrays.
Quick Tools for Creating LaTeX Equations
Want a visual equation editor?
Use our interactive Equation Editor to build complex equations visually and get the LaTeX code instantly.
Open Equation Editor
Have an image of an equation?
Upload an image of your mathematical equation and we'll convert it to LaTeX code using AI technology.
Try Image to LaTeX