missing $ inserted

14,756

You have a double newline (i.e. a blank line) in the second code snippet. This causes TeX to drop out of math mode in an attempt to correct this error, hence the subsequent errors about missing $s.

Share:
14,756
nina
Author by

nina

Updated on August 04, 2022

Comments

  • nina
    nina almost 2 years

    Hi I have trubles with compiling this

        \begin{equation}
    J = \sum_{j=1}^{C}
    \end{equation}
    

    I constantly gets an error

    missing $ inserted

    which is quite strange because I'm pretty sure that I'm in math environment I alsow tried this

    \begin{equation}
    J = $\sum_{j=1}^{C}$
    \end{equation}
    

    or this

    \begin{equation}
    J = $\sum_{$j=1$}^{$C$}$
    \end{equation}
    

    but it didnt't do the trick

    EDIT The only thing above is

     \begin{equation}
     d_{ij}^2 = || x_{i} - p_{ij}||^2 = || x_{i} - (R_{j}s_{j}p_{ij}^* + t_{j}  ) ||^2
    
    \end{equation}
    

    However if I delete this the document compile. It seems that in this section there is some error

    • Aasmund Eldhuset
      Aasmund Eldhuset over 13 years
      Indeed, your first code snippet seems correct. Are you absolutely sure that there are no mismatched dollar signs elsewhere in the document?
    • SiggyF
      SiggyF over 13 years
      This equation seems fine, might it be somewhere else in your document? Maybe try to comment this section out. Do you have any special characters outside of an equation or any loose $?
    • Ulrich Schwarz
      Ulrich Schwarz over 13 years
      Try ignoring the error (by answering Q at the error prompt) and looking at the output. The place where TeX inserted the $ is obvious because all the letters turn to maths.
    • nina
      nina over 13 years
      I edited the question. Please take a look
  • Aasmund Eldhuset
    Aasmund Eldhuset over 13 years
    Interesting; I didn't know that that could cause problems. +1.