Large braces for specifying values of variables by condition
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}
Another method, which is especially helpful if one needs to have more control over the items alignment, is the array
construct.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
X=\left\{
\begin{array}{@{}ll@{}}
0, & \text{if}\ a=1 \\
1, & \text{otherwise}
\end{array}\right.
\end{equation}
\end{document}
Instead of ll
, one may choose cc
, rr
, rl
, etc. Besides, all the array
capabilities can be applied here (\arraycolsep
, \arraystretch
, \extrarowheight
by loading the array
package, etc).
One more alternative could be using the aligned
environment and adding the pseudo-parenthesis .
, which can be used to terminate an opening parenthesis {
.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
X = \left \{
\begin{aligned}
&0, && \text{if}\ a=1 \\
&1, && \text{otherwise}
\end{aligned} \right.
\end{equation}
\end{document}
x = \begin{cases}
0, & \text{if } a = 1, \\
1, & \text{otherwise}.
\end{cases}
amsmath
is needed for \text
.