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}
  • 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 '17 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!? – Manuel Weinkauf Oct 2 '17 at 13:44
  • 3
    @ManuelWeinkauf No, the & and \\ is inside a cases environment. – Torbjørn T. Oct 2 '17 at 17:25
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}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.