## LaTeX forum ⇒ Math & Science ⇒ Rightarrow gives Missing $inserted error Topic is solved Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs). thinkpadder Posts: 5 Joined: Fri May 21, 2021 12:01 pm ### Rightarrow gives Missing$ inserted error

On this very basic math formula:

\documentclass[a5paper,12pt]{article}
\usepackage{amsmath}
\begin{document}

if $n = 0$ then $a_n = 0$; if $n \geq 1$ then $a_n = 1$

\end{document}


I'd like to replace the if and then words with one \Rightarrow so that it will look better

but when I do it and write:

\documentclass[a5paper,12pt]{article}
\usepackage{amsmath}
\begin{document}

$n = 0$ \Rightarrow $a_n = 0$; $n \geq 1$ \rightarrow $a_n = 1$

\end{document}

it gives error (using Miktex pdflatex. exe or xelatex.exe)

! Missing $inserted. <inserted text>$
l.5 $n = 0$ \Rightarrow
$a_n = 0$; $n \geq 1$ \rightarrow $a_n = 1$
?

Considering \Rightarrow is found inside the amssymb package I add \usepackage{amssymb} but the same error.

How to add \Rightarrow inside those math expressions?

Ijon Tichy
Posts: 502
Joined: Mon Dec 24, 2018 10:12 am
Just stay in math mode for the whole formula:
\documentclass[a5paper,12pt]{article}
\usepackage{amsmath}
\begin{document}

Use either:
$n = 0 \Rightarrow a_n = 0; n \geq 1 \rightarrow a_n = 1$
for an inline formula or
$n = 0 \Rightarrow a_n = 0; n \geq 1 \rightarrow a_n = 1$
for displayed math.

\end{document}

BTW: You don't need amsmath for this. Nevertheless amsmath is a recommended package for math. I even would recommend mathtools, an extension of amsmath. See the manuals for more information.