Tx · LaTeX & TikZ

How to Write Math Symbols in LaTeX

Published By the 9to5Science editorial team

At a glance

  1. 1. Identify the symbol

    Determine the symbol’s name or meaning; LaTeX commands depend on which glyph you need.

  2. 2. Use math mode

    Put math expressions between dollar signs or use a displayed equation environment.

  3. 3. Add a package if needed

    Load a package such as amssymb when a symbol is not available in the core LaTeX set.

  4. 4. Compile and check

    Compile the example and confirm that the printed glyph matches the symbol you intended.

“LaTeX math symbol” could refer to many different glyphs, and each has its own command. The general pattern is to put the command in math mode: for example, $\alpha$ prints the Greek letter alpha, and $\infty$ prints infinity. This guide shows how to enter common symbols, find less familiar ones, and handle package requirements.

Put symbols in math mode

Most mathematical commands work only in math mode. For a short expression within a sentence, use dollar signs: $a^2+b^2=c^2$. For a separate, centered equation, use \[ ... \] in your LaTeX source. For example:

\[
x^2 + y^2 = z^2
\]

In the article text, LaTeX snippets are shown in backticks; inside your document, use the actual delimiters shown in the snippet. Don’t put ordinary prose in math mode unless it is part of a mathematical expression. For words inside an expression, use \text{...}, provided by the amsmath package, as in $P(\text{success})$.

Common symbol commands

The command usually resembles the symbol’s name. These examples work in standard LaTeX math mode unless a package is noted.

SymbolLaTeX sourceTypical use
α\alpha, Γ\Gamma\alpha, \GammaGreek letters
∞\infty\inftyInfinity
≤\leq, ≠\neq\leq, \neqLess than or equal to; not equal to
∈\in, ∉\notin\in, \notinSet membership
×\times, ⋅\cdot\times, \cdotMultiplication signs
∑\sum, ∫\int\sum, \intSummation and integration
R\mathbb{R}\mathbb{R}The real numbers; requires amssymb or amsfonts

Capitalization matters for Greek letters: \alpha gives lowercase alpha, while \Gamma gives uppercase Gamma. Some uppercase Greek letters look like Latin letters and therefore have no separate command. For example, uppercase alpha is normally written as A.

A complete compiling example

This example uses the amssymb package for the blackboard-bold symbol \mathbb{R}. The other shown commands are standard math commands.

\documentclass{article}
\usepackage{amssymb}

\begin{document}

Let $x \in \mathbb{R}$ with $|x| \leq 2$ and $\alpha > 0$. Then
\[
  x^2 + 1 \leq \sum_{k=1}^{3} k = 6.
\]

\end{document}

Save the source as a .tex file and compile it with a LaTeX engine such as pdfLaTeX. The inline expression uses \in for “is an element of” and \mathbb{R} for the real numbers. The displayed expression uses \leq for “less than or equal to” and \sum with lower and upper limits. The package line makes \mathbb available.

How to find a symbol you don’t know

First, identify the symbol’s name or mathematical role: is it a relation, an operator, a Greek letter, or a special integral? Then search a LaTeX symbol list or the documentation for a likely package using that name. Searching by a description such as “not subset” or “decorated integral” is often more effective than searching only for “math symbol.”

If you know the Unicode character, searching for its name can help identify the corresponding LaTeX command. Be careful about copying a glyph directly into your source: support for direct Unicode input depends on the engine and its configuration. A command such as \notin is often more portable across LaTeX setups.

Some symbols need additional packages. For instance, \mathbb is supplied by amsfonts and is also available when you load amssymb. The amsmath package provides additional equation environments and math features. Load only the package you need, and check its documentation if LaTeX reports “Undefined control sequence”—that error commonly means the command is misspelled or its package has not been loaded.

Common mistakes

  • Leaving math mode: Writing \alpha in ordinary text may produce an error. Use $\alpha$ or another math-mode delimiter.
  • Using the wrong command spelling: Commands are case-sensitive. \infty is valid; \Infinity is not a standard command.
  • Forgetting a package: If \mathbb{R} fails, add \usepackage{amssymb} in the preamble.
  • Using text characters as substitutes: A typed x is not the multiplication sign \times, and a hyphen is not the minus sign $-$. Choose the command that conveys the intended meaning.
  • Adding spacing commands to fix the wrong problem: If a symbol looks wrong, first check the command, math mode, and package. Manual spacing will not correct a mistaken glyph.

The exact command depends on the particular symbol. If you can provide its appearance or describe what it means, you can narrow the lookup to the right command and package.

References

  1. The LaTeX2e unofficial reference manual

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.