[Tex/LaTex] Large braces for specifying values of variables by condition

bracesconditionals

How do I produce a conditional expression with large brackets?

For example:

X = 0 if a=1, 1 otherwise, with a large left bracket and specifying each condition in a line?

Best Answer

The cases environment from amsmath does the trick.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
  \begin{equation}
    X=
    \begin{cases}
      0, & \text{if}\ a=1 \\
      1, & \text{otherwise}
    \end{cases}
  \end{equation}
\end{document}

Result