Math & Science"Missing $ inserted" Problem in Table

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
vicsweet
Posts: 2
Joined: Sat Jul 09, 2011 3:35 pm

"Missing $ inserted" Problem in Table

Post by vicsweet »

I am editing a table, but two rows provoking "Missing $ inserted" notification. Following is the table script

Code: Select all

1573	\begin{table}[htbp]
1574	\centering \caption{Code assigning rule \label{tab:codeassigning}}
1575	\begin{tabular}{||c|c|c|c||c||}\hline
1576	\multicolumn{2}{||c|}{Pre-treatment} & \multicolumn{2}{|c||}{Post-treatment} & Code\\
1577	\cline{1-4}
1578	
1579	$r_1$ & Significance & $r_2$ & Significance &
1580	\\ \hline
1581	
1582	Positive &  $\leq$ .01 &  Negative &  $\leq$ .01  &  -1 \\
1583	\hline
1584	
1585	Positive &  \textgreater .01 &  Negative &  $\leq$ .01  &  -1 \\ \hline
1586	
1587	Positive &  $\leq$ .01 &  Negative &  \textgreater .01 &  -1 \\ \hline
1588	
1589	Positive &  \textgreater .01 &  Negative &  \textgreater .01 &  0 \\ \hline
1590	
1591	Positive &  $\leq$ .01 &  Positive &  $\leq$ .01 &  \[ \left\{
1592	\begin{array}{l}
1593	1,\left| {r_2 } \right|  \ge \left| {r_1 } \right|  \\
1594	0,\left| {r_2 } \right|  < \left| {r_1 } \right|  \\
1595	\end{array} \right.
1596	\]
1597	\\ \hline
1598	
1599	Positive &  \textgreater .01 &  Positive &  $\leq$ .01 &  1 \\ \hline
1600	
1601	Positive &  $\leq$ .01 &  Positive &  \textgreater .01 &  -1 \\ \hline
1602	
1603	Positive & \textgreater .01 &  Positive &  \textgreater .01 &  0 \\ \hline
1604	
1605	Negative &  $\leq$ .01 &  Positive &  $\leq$ .01 &  1 \\ \hline
1606	
1607	Negative & \textgreater .01 &  Positive &  $\leq$ .01 &  1 \\ \hline
1608	
1609	Negative & $\leq$ .01 &  Positive  & \textgreater .01 & 1 \\ \hline
1610	
1611	Negative & \textgreater .01 &  Positive  & \textgreater .01 & 0 \\ \hline
1612	
1613	Negative & $\leq$ .01 & Negative & $\leq$ .01 & \[ \left\{
1614	\begin{array}{l}
1615	-1,\left| {r_2 } \right|  \ge \left| {r_1 } \right|  \\
1616	0,\left| {r_2 } \right|  < \left| {r_1 } \right|  \\
1617	\end{array} \right.
1618	\]
1619	\\ \hline
1620	
1621	Negative & \textgreater .01 & Negative & $\leq$ .01 & -1 \\ \hline
1622	
1623	Negative & $\leq$ .01 & Negative & \textgreater .01 & 1 \\ \hline
1624	
1625	Negative & \textgreater .01 & Negative & \textgreater .01 & 0 \\ \hline
1626	
1627	\end{tabular}
1628	\end{table}
The error message is as follows:

Code: Select all

! Missing $ inserted.
<inserted text> 
                $
l.1591 ...01 &  Positive &  $\leq$ .01 &  \[ \left
                                                  \{
? 
! Missing $ inserted.
<inserted text> 
                $
l.1596 \]
         
? 
! Missing $ inserted.
<inserted text> 
                $
l.1613 ...$ .01 & Negative & $\leq$ .01 & \[ \left
                                                  \{
? 
! Missing $ inserted.
<inserted text> 
                $
l.1618 \]
         
? 
Attached is the table formatted. Anyone can find out ways to avoid the error messages? Thanks.
Attachments
Missing$.jpg
Missing$.jpg (72.73 KiB) Viewed 8080 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: "Missing $ inserted" Problem in Table

Post by Stefan Kottwitz »

Hi,

\[ ... \] is for displayed equations, don't use it within table cells. Use inline math mode instead, i.e. \( ... \) or $ ... $. If you need the same style as in displayed equations, use \displaystyle within the inline math formula.

Stefan
LaTeX.org admin
vicsweet
Posts: 2
Joined: Sat Jul 09, 2011 3:35 pm

"Missing $ inserted" Problem in Table

Post by vicsweet »

Stefan_K wrote:Hi,

\[ ... \] is for displayed equations, don't use it within table cells. Use inline math mode instead, i.e. \( ... \) or $ ... $. If you need the same style as in displayed equations, use \displaystyle within the inline math formula.

Stefan

It worked. Thank you very much.
Post Reply