# $errors in inline mathematical equation I want to make the following in-text formula and I am a LaTeX beginner:  \begin{math}$ES_{\alpha}$=$-E[R|R≤-$VaR_\alpha$]$\end{math}.  I do, however keep getting this message: ! Missing$ inserted.
<inserted text>
$1.29...in {math}$$ES_{\alpha}$= -E [$R|R≤-$VaR_\alpha$]$\end{math}.The a.....


I have already tried to alter the position of $ multiple times. Could someone perhaps explain in which cases is a $ needed, except for subscript and superscript because that part is clear to me. I am interested in the use of $ in the in-text mathematical equations in general. • \begin{math} is an alternative to $ use one or the other not both, just remove all the $ from your example. – David Carlisle May 11 '17 at 11:16 • Why not just $ES_{\alpha} = -E[R|R≤- VaR_\alpha ]$ ? – Steven B. Segletes May 11 '17 at 11:17 • @StevenB.Segletes \mathrm{Var} – David Carlisle May 11 '17 at 11:17 • What he said!... ($ES_{\alpha} = -E[R|R≤- \mathrm{Var}_\alpha ]$) – Steven B. Segletes May 11 '17 at 11:18 ## 1 Answer Assuming that ES and VaR are acronyms that stand for "expected shortfall" and "Value at Risk", respectively, I would write the expression as follows: $\mathrm{ES}_{\alpha}=-\E[\,R\mid R\le-\mathrm{VaR}_\alpha\,]$ Here, \E is a macro that denotes the expectation operator. Observe that you should enter and exit math mode only one time each. A full MWE: \documentclass{article} \usepackage{amsmath} \DeclareMathOperator{\E}{E} % expectation operator \begin{document}$\mathrm{ES}_{\alpha}=-\E[\,R\mid R\le-\mathrm{VaR}_\alpha\,]\$
\end{document}