# What is wrong with this LaTeX equation?

In the math mode, I am typing an equation and I am constantly getting errors such as

Undefined Control Sequence etc.

I have tried all things to my knowledge, but I am missing something. Can someone help me?

$$\large \alpha_b = \left\{ {\text{1, I_{i,r}^b \geq I_{thr}} \atop \text{0, I_{i,r}^b < I_{thr}} \right}$$

• _ is a math mode command. It must only appear in math mode. You have it within \text{ ... } which puts you in text mode unsurprisingly. So _ is undefined and fails – Au101 Nov 9 '16 at 3:53
• Also you seem to have \right} at the end, where I assume you want \right\} – Au101 Nov 9 '16 at 3:58

This is the correct way to type in the equation.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$$\alpha_b = \begin{cases} 1, & I_{i,r}^b \geq I_{thr} \\ 0, & I_{i,r}^b < I_{thr} \end{cases}$$

\end{document}


Depending on its meaning, “thr” could be better as

I_{\mathrm{thr}}


Use this if it's a textual abbreviation.

The command \large is not allowed in math mode. Probably you wanted to use it for enlarging the result of \atop. But \atop is not to be used anywhere in LaTeX, if you load amsmath (and you do, because you have \text).

The command \text is used to insert textual parts in an equation, but you're using it for math parts; finally \right} is not allowed and it should be \right. for a null delimiter.

However, using a fraction for doing a cases environment is wrong to begin with. I'm quite surprised you know about \atop and not about cases. If \atop has been suggested to you by a friend, this could be a good occasion for breaking this friendship. ;-)

• takes his TeX seriously, you understand? You don't wanna know what happened to the guy who ended all his paragraphs with \\ :P :) – Au101 Nov 9 '16 at 12:37
• @Au101 Students who do that don't get their degree! – egreg Nov 9 '16 at 12:44
• Maybe it's better to load mathtools instead of amsmath. (I know it doesn't make a difference here.) Also, what's the difference between \mathrm and \textup in the subscript? – Svend Tveskæg Nov 13 '16 at 20:16
• @SvendTveskæg I think that mathtools should be rewritten from scratch, so I load it only when it's really necessary. – egreg Nov 13 '16 at 20:18
• @Dr.ManuelKuehner The code is an unreadable mix of classical and obsolete expl3-like style. Very difficult to maintain. – egreg May 16 at 21:17

Here is a possible solution:

\documentclass{article}

\begin{document}

$$\alpha_b = \left\{\frac{1, I_{i,r}^b \geq I_{thr}}{0, I_{i,r}^b < I_{thr}}\right\}$$
or
$$\alpha_b = \left\{\frac{1, I_{i,r}^b \geq I_{\mathrm{thr}}}{0, I_{i,r}^b < I_{\mathrm{thr}}}\right\}$$

\end{document}


The latter should be used if the subscripts to the right are text.