Alignment in equation environment
I'd forego the use of \displaystyle
, setting the entire construction using amsmath
's cases
:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Consider the following:
\[
P\bigl[ \tfrac{1}{2} +\mu \bigr] = \begin{cases}
0 & \text{if }\mu <-\tfrac{1}{2} \\
\tfrac{1}{2} + \mu & \text{if }-\tfrac{1}{2} \leq \mu \leq \tfrac{1}{2} \\
1 & \text{if }\mu > \tfrac{1}{2}
\end{cases}
\]
\end{document}
You can increase the gap between rows inside the cases
environment using \\[<len>]
, where you specify the length <len>
(say 2\jot
or 20pt
, say).
Here's a solution that uses the dcases
environment provided by the mathtools
package. It works like cases
, except that all contents are rendered in \displaystyle
automatically. The screenshot also shows the output of the corresponding cases
environment.
\documentclass[12pt,a4paper]{article}
\usepackage{mathtools}
\begin{document}
Consider the following:
\[
P\Bigl[ \frac{1}{2}+\mu \Bigr]=
\begin{dcases}
0 & \text{if}\quad\phantom{{-}\frac{1}{2}\leq{}}\mu <-\frac{1}{2} \\
\frac{1}{2}+\mu & \text{if}\quad{-}\frac{1}{2}\leq \mu \leq +\frac{1}{2} \\
1 & \text{if}\quad{+}\frac{1}{2}<\mu
\end{dcases}
\]
\[
P\bigl[ \tfrac{1}{2}+\mu \bigr]=
\begin{cases}
0 & \text{if}\quad\phantom{{-}\frac{1}{2}\leq{}}\mu <-\frac{1}{2} \\
\frac{1}{2}+\mu & \text{if}\quad{-}\frac{1}{2}\leq \mu \leq +\frac{1}{2} \\
1 & \text{if}\quad{+}\frac{1}{2}<\mu
\end{cases}
\]
\end{document}
Here's a solution that aligns three columns, adapted from this answer.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Consider the following:
\[
P\Big[\frac{1}{2}+\mu \Big] =
\setlength{\arraycolsep}{0pt}
\renewcommand{\arraystretch}{2}
\left\{
\begin{array}{l @{\quad} l r l}
0 & \text{if } & \mu &{}< -\dfrac{1}{2}\\
\dfrac{1}{2} & \text{if } & -\dfrac{1}{2} &{}< \mu < \dfrac{1}{2}\\
1 & \text{if } & \mu &{}> \dfrac{1}{2}.
\end{array}
\right.\]
\end{document}
I made a couple simplifications: you can use \dfrac
rather than carrying around \displaystyle
all the time, and \text
behaves better than \mathrm
(though it does require you to use amsmath
). The \arraystretch
line sets the vertical spacing, preventing collisions.