FormaTeX
FatalMath Mode

Missing Dollar Sign (Math Outside Math Mode)

! Missing $ inserted.

What this error means

A math command or symbol (like _, ^, \alpha, \frac) was used outside of math mode. LaTeX only interprets these as math when they appear between $ delimiters or inside a math environment.

Common causes

  • Using _ for subscript or ^ for superscript in normal text
  • Using \alpha, \beta, or other Greek letters outside math mode
  • Forgetting to open math mode with $ or \(
  • An \end{equation} closed the environment but math symbols follow

How to fix it

Wrap math content in inline math mode with $...$ or \(...\), or use a display math environment like \begin{equation}...\end{equation}. For subscripts in text use \textsubscript{} and for superscripts use \textsuperscript{}.

Code examples

Causes the error
\documentclass{article}
\begin{document}

The value is x_1 + y^2 = z.
Let \alpha be a constant.

\end{document}
Fixed
\documentclass{article}
\begin{document}

The value is $x_1 + y^2 = z$.
Let $\alpha$ be a constant.

\end{document}

Related errors

Test the fix live

Paste your LaTeX into the playground and compile instantly.

One quick thing

We track anonymous usage — page views, feature usage, compilation events — to understand what works and what doesn't. No ads, no personal data, no third-party sharing.

Cookie policy