4

Been trying to this lines, but getting the error of Missing $ inserted ,

\begin{equation}
\left \{
\begin{tabular}{ccc}
R_{e_1,...,e_k} & when T_{e_1,...,e_k} > 0 & and BEL(R_{e_1,...,e_k}) \geq \alpha \\
& & \\
M+1& otherwise&\\
\end{tabular}
\right
\end{equation}

Could anyone please tell me why I'm getting This error?

1
  • 2
    Since you are using a table, anything inside is set as text mode and since you have math expressions, then these should be set in $<math content>$. Hence, R_{e_1,...,e_k} should be in math mode and not in text mode.
    – azetina
    Jun 13, 2016 at 2:37

3 Answers 3

6

Alternatively, I'd put this in a cases environment (additionally, BEL should be treated like an operator or function instead of the product of three variables B, E, and L; and also using \ldots):

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\bel}{BEL}
\begin{document}
\begin{equation}
x = 
\begin{cases}
R_{e_1,\ldots,e_k} & \text{when } T_{e_1,\ldots,e_k} > 0 \text{ and } \bel(R_{e_1,\ldots,e_k}) \geq \alpha \\
M+1 & \text{otherwise} \\
\end{cases}
\end{equation}
\end{document}

enter image description here

3
  • 3
    +1. However, I wouldn't put a space between \text{ and when.
    – Mico
    Jun 13, 2016 at 5:42
  • No spaces mean the words get smashed up against the math. Would you add math-mode spacing, or do something else I've not considered? Jun 13, 2016 at 17:04
  • Sorry I wasn't clear: The only space I'd remove is the one immediately ahead of "when" -- observe that it is currently not lined up with the word "otherwise".
    – Mico
    Jun 13, 2016 at 19:36
5

All mathematical expressions, as R_{e_1,...,e_k} shoud be in dollars: $R_{e_1,...,e_k}$ , or better $R_{e_1,\ldots,e_k}$. But much easier and more natural is to change your tabular into array (using amsmath is assumed to have \text macro):

\begin{equation}
\left \{
\begin{array}{ccc}
R_{e_1,\ldots,e_k} & \text{when }T_{e_1,\ldots,e_k} > 0 & \text{ and }BEL(R_{e_1,\ldots,e_k}) \geq \alpha \\
& & \\
M+1& \text{otherwise}&\\
\end{array}
\right.
\end{equation}

Please observe also that there was a missing dot after closing \right (should be \right.).

0
1
\documentclass{article}

\usepackage{amsmath}
\begin{document}
\begin{equation}
\left \{
\begin{tabular}{ccc}
$R_{e_1,...,e_k}$ & when $T_{e_1,...,e_k} > 0$ & and $BEL(R_{e_1,...,e_k})\geq \alpha$\\
& & \\
$M+1$& otherwise&\\
\end{tabular}
\right \}
\end{equation}

equa

1
  • 4
    You didn't really tell him why he was getting the error...
    – MCMastery
    Jun 13, 2016 at 4:31

You must log in to answer this question.

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