Underleaf Logo
Underleaf
PricingBlogInstall for OverleafStart for free

Learn LaTeX

Text Formatting

  • Bold Text in LaTeX
  • Italics in LaTeX
  • Subscript and Superscript
  • Greek Letters and Symbols

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:

  1. Inline Math Mode

    For mathematical expressions that are part of a text paragraph. Delimited by either $...$ or \(...\):

  2. 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

TypeLaTeX CodeResult
Fractions\frac{a}{b}
Exponentsx^2
Subscriptsx_i
Square Root\sqrt{x}

Equation Environments

LaTeX provides several environments for displaying equations:

  1. equation Environment

    For numbered equations:

    \egin{equation}E = mc^2\end{equation}

  2. equation* Environment

    For unnumbered equations:

    \egin{equation*}F = ma\end{equation*}

  3. 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:

OperatorLaTeX CodeResult
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) - use align instead
  • Don't forget to load required packages (amsmath, amssymb) in the preamble
  • Avoid mixing text and math mode unnecessarily
Underleaf Logo
Underleaf

Empowering students and researchers with AI-powered tools for academic writing.

Company

PricingGuideBlogLearn

© 2025 Underleaf. All rights reserved.