1

I used the following code in overleaf but it isn't showing the requisite result. Any comments?

Let us label the two sides as A and B, and then define:

\begin{equation}

a_{_{i}}(t)= \begin{cases}

& 1, \text{ if side A is chosen}  \\

& (-1),  \text{ if side B is chosen} 

\end{cases}

\end{equation}
3
  • 4
    Do you really have blank lines in the input or is this just a by-product of the edit? And what's the problem? What's the required result like and what are you getting? No blank lines, a_{_i} should be a_{i} and there should be & before \text.
    – egreg
    Oct 2, 2017 at 13:07
  • 1
    @egreg The & before \text would only make sense if \begin{equation}...\end{equation} would be replaced with \begin{align}...\end{align}, or alternatively \begin{split}...\end{split} would be used within the equation-environment, wouldn't it!? Oct 2, 2017 at 13:44
  • 3
    @ManuelWeinkauf No, the & and \\ is inside a cases environment. Oct 2, 2017 at 17:25

1 Answer 1

3

Did you \usepackage{amsmath}?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath} % this is needed
\begin{document}
\begin{equation}
a_{_{i}}(t)= 
\begin{cases}
& 1, \text{ if side A is chosen} \\
& (-1), \text{ if side B is chosen}
\end{cases}
\end{equation}
\end{document}

You must log in to answer this question.

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