I want to make the following in-text formula and I am a LaTeX beginner:


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.

  • 3
    \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
  • 1
    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

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:

enter image description here

\DeclareMathOperator{\E}{E} % expectation operator
$\mathrm{ES}_{\alpha}=-\E[\,R\mid R\le-\mathrm{VaR}_\alpha\,]$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.