[Tex/LaTex] Missing $ inserted error using smaller than and smaller equal

errorsmath-modesymbolstables

I have a compilation error trying to use the math symbols <= <, etc.

the error looks like this:

./chapters/intro.tex:49: Missing $ inserted. [Delta & \delta],
./chapters/intro.tex:49: Missing $ inserted. [Delta & \delta < 4Hz &]
./chapters/intro.tex:50: Missing $ inserted. [Theta &  4Hz < \theta]
./chapters/intro.tex:50: Missing $ inserted. [Theta &  4Hz < \theta \leq 8Hz &]

and this is the code causing it

\begin{tabular}{l l l}
\hline
EEG rhythm & Frequency band & Mental association \\
\hline
Delta & \delta < 4Hz & Sleep \\
Theta &  4Hz < \theta \leq 8Hz & Sleep \\
\hline
\end{tabular}

I know there have been similar question but I read the answers and I could not figure it out for my case.

Thanks!

Best Answer

There are actually two issues with the way you're typesetting these tables. First, as already noted in @cfr's answer, you must use TeX's math mode for the macros \delta, \theta, and \leq (as well as for getting the proper spacing around the symbol <). Second, you need to apply some care with the way you enter numbers and their scientific units. The most straightforward way I can think of to handle the second issue is to load the siunitx package and to use its \SI macro. Using the \SI macro will insert the right amount of space between the number and the unit and will typeset the units in upright Roman mode rather than in math italic mode.

enter image description here

\documentclass{article}
\usepackage{siunitx}  % for '\SI' macro
\begin{document}
\begin{tabular}{l l l}
\hline
EEG rhythm & Frequency band & Mental association \\
\hline
Delta & $\delta < \SI{4}{Hz}$ & Sleep \\
Theta &  $\SI{4}{Hz} < \theta \leq \SI{8}{Hz}$ & Sleep \\
\hline
\end{tabular}
\end{document}
Related Question