1

I am trying to use the CRPS formula in Latex and I am very new to it. I am getting a Missing $ inserted error from the equation below. I know it's a common problem, but I haven't been able to solve it. Please help!

CRPS = \int_{-\infty }^{\infty }
       \left [ F_{y\right}\left (y \right )-1\left ( y \geq x\big\ \right ) \right]]^{2}dy

Hi, this is a part of the thesis template of my university. I am not supposed to edit the preamble.

6
  • 1
    What exactly are you trying to typeset? Note that \left<delimiter> should match a \right<delimiter> without any space e.g., \left( .... \right). You can start fixing the code by F_{y} and removing right}
    – percusse
    Apr 5, 2013 at 5:47
  • Welcome to TeX.SE. While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. Apr 5, 2013 at 5:56
  • Have you surrounded the code snippet by something like \begin{equation} and \end{equation}?
    – Mico
    Apr 5, 2013 at 6:37
  • @mico Yes. I have,
    – asd
    Apr 5, 2013 at 6:43
  • 1
    I would also check in nearby equations, especially those inline with your text. Depending on your editor, it may not be too apparent if you accidentally missed a $ (or inserted an extra one), which would certainly cause this error. Apr 5, 2013 at 8:01

1 Answer 1

2
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
  \textrm{CRPS} = \int_{-\infty}^{\infty}
       \left[F_{y}\left(y \right)-1\left(y \geq x\right) \right]^{2}\textrm{d}y
\end{equation}
\end{document}

enter image description here

Or

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
  \textrm{CRPS} = \int\limits_{-\infty}^{\infty}
       \left[F_{y}\left(y \right)-1\left(y \geq x\right) \right]^{2}\textrm{d}y
\end{equation}
\end{document}

enter image description here

Edit:

The bunch of \left and \rights are not needed as noted in the comments. Further, this will work without amsmath. (I add amsmath/mathtools instinctively :-)).

Adding to the above the equation:

\textrm{CRPS} = \int\limits_{-\infty}^{\infty}
       \left[F_{y}\left(y \right)-1\left(y \geq x\right) \right]^{2}\textrm{d}y

when copy pasted in to http://www.codecogs.com/latex/eqneditor.php works for me:

enter image description here

Hence, if it is not working for you, you may have to give some more details for trouble shooting.

15
  • So what exactly is that inequality doing there? :)
    – percusse
    Apr 5, 2013 at 6:03
  • 2
    @percusse I dunno ;-). May be OP knows.
    – user11232
    Apr 5, 2013 at 6:05
  • Hi, this is a part of the thesis template of my university and I inserted \textrm{CRPS} = \int\limits_{-\infty}^{\infty} \left[F_{y}\left(y \right)-1\left(y \geq x\right) \right]^{2}\textrm{d}y But it doesn't work. Same error. Any suggestions? Can we do it without using amsmath. I am not supposed to edit the preamble.
    – asd
    Apr 5, 2013 at 6:28
  • 1
    @asd, without access to more information, we won't be able to help you beyond this: this code works under normal circumstances. Some funny stuff might be happening in your preamble, and it would be worth sharing even if you can't change it. Apr 5, 2013 at 7:55
  • 1
    @asd:You better post a MWE. What are you trying to do? Why you are copy pasting equation in that site? Instead directly use the equation in your tex file (from \begin{equation}.....\end{equation) and complile the tex file with pdflatex. It should give the equation number.
    – user11232
    Apr 6, 2013 at 14:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .