5

So I want to represent two results for a variable in math mode, and there is something that I don't know the name in English for, which is a big "{". What I want to do is the following:

\begin{equation}
 \pi(s) = {^{x if s = 5}_{y if s = 4}  
\end{equation}

But with a normal size and I don't think this is the correct way. So this line would occupy +- 2 lines instead of 1.

  • 1
    { is a left brace. – Bernard May 18 at 19:02
9

I think you are looking for cases.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\pi(s)=\begin{cases}
x & \text{if $s = 5$}\\
y & \text{if $s = 4$}
\end{cases}
\]
\end{document}

enter image description here

  • what is the \[ and \] for? – Miguel Saraiva May 18 at 19:04
  • @MiguelSaraiva \[ and \]? They are for unnumbered math mode, aren't they? What do you mean? – user156344 May 18 at 19:04
  • Right, i'm used to using $$ or begin equation I forgot that was a thing. Thank you – Miguel Saraiva May 18 at 19:05
  • @MiguelSaraiva Well, using equation is very okay, but please do not use $$! – user156344 May 18 at 19:05
  • 1
    @MiguelSaraiva Ah, it is okay. Very okay :) – user156344 May 18 at 19:08

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.