Hi,
I use TeXlive in Ubuntu.
I've been compiling a tex file, with the following table.
-------------------------------------------------------------------------------------------------------------------------
...............................................
\begin{table}
\caption{Results of fits for LiF \label{tab:LiFresults}}
\begin{tabular}{| c | c | c | c |}
\hline
Peak & n & Characteristic line & $2 \theta$ \\
\hline
1 & 1 & $K_{\beta}$ & 40.371 \pm 0.026^{\circ} \\
\hline
2 & 1 & $K_{\alpha}$ & 44.879 \pm 0.005^{\circ} \\
\hline
3 & 2 & $K_{\beta}$ & 87.148 \pm 0.308^{\circ} \\
\hline
4 & 2 & $K_{\alpha}$ & 99.510 \pm 0.055^{\circ} \\
\hline
\end{tabular}
\end{table}
..................................etc.etc.
------------------------------------------------------------------------------------------------------------
The compiling works. But I get warnings. Here is an excerpt from the output.
------------------------------------------------------------------------------------------------------------
...............
! Missing $ inserted.
<inserted text>
$
l.206 1 & 1 & $K_{\beta}$ & 40.371 \pm
0.026^{\circ} \\
? ! Extra }, or forgotten $.
<template> \unskip \hfil }
\hskip \tabmidsep \relax \hskip -.5\arrayrulewidth...
l.207 \hline
? ! Missing $ inserted.
<inserted text>
$
l.207 \hline
? ! Missing } inserted.
<inserted text>
}
l.207 \hline
? ! Missing $ inserted.
<inserted text>
$
l.208 2 & 1 & $K_{\alpha}$ & 44.879 \pm
0.005^{\circ} \\
...............etc. etc.
-----------------------------------------------------------------------------------------------
I get a list of such warning from this and another table. Although the compiling works, the warning are cluttering my output, and I'm afraid that I won't be able to spot an important warning or an error because I don't have the time to check it carefully every time it compiles.
What did I do wrong?
Or is it something wrong with the compiler?
Thanks
General ⇒ I get "missing $ inserted" but don't know why
I get "missing $ inserted" but don't know why
Last edited by Jacare on Tue Apr 12, 2011 12:45 am, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
I get "missing $ inserted" but don't know why
Please always provide a full but minimal example [1]. Otherwise specific help is nearly impossible especially when a problem becomes more complicated.Jacare wrote:[…] The compiling works. But I get warnings. Here is an excerpt from the output. […]
Compilation is far from being flawlessly. And you get no warnings but solid error messages. The commands \pm and ^ (for superscript) only work in math mode.
[1] View topic: Avoidable mistakes
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
I get "missing $ inserted" but don't know why
localghost wrote:Source code has to be tagged as such by using the »Code« environment of the foum software
Sorry. My fault. Won't happen again.localghost wrote:Please always provide a full but minimal example [1].
Yes! That solved it! Thanks!localghost wrote:The commands \pm and ^ (for subscript) only work in math mode.