TeXpad

LaTeX error: Missing $ inserted

Subscripts (_), superscripts (^), and math commands such as \frac or \alpha only work in math mode. When TeX finds one in running text it inserts a $ to switch into math, which almost never matches what you meant, and reports the error.

! Missing $ inserted.

Try it: this example has the error

Press Fix it in the error box, and it compiles to a PDF. What pdfTeX printed for it:

! Missing $ inserted.
<inserted text> 
                $
l.3 The first value x_
                      1 is positive.
or paste your own document

Ready. Press Compile (or Ctrl/Cmd + Enter).

Open in the full editor →

Common causes

How to fix it

  1. Wrap the formula in $…$ for inline math, or \[ … \] for a displayed equation.
  2. For a literal underscore in text, use \_; for a literal caret, use \textasciicircum.
  3. TeXpad finds the formula on the reported line and offers "Wrap … in $…$".

Related errors