[Tex/LaTex] How to stop fractions in display equations from running into each other

alignamsmatharraysfractions

Is there some standard way to create multiple display equations like the following

enter image description here

without having to use:

  1. \renewcommand*{\arraystretch}{2} (so that the two rows in the second equation don't get too close to each other)
  2. array environment (so that I can use \renewcommand*{\arraystretch}{2}. Can't use the align environment again)
  3. \displaystyle (so that things would be displayed the way they would if I used align)

as I've done below? My solution just seems like such a kludgy hack. There has to be a better/standard way…right?

\documentclass[10pt]{article}
\usepackage{amsmath}
\begin{document}
\renewcommand*{\arraystretch}{2}{
    \begin{align*}
      \pi(\mu \mid x) &= \frac{\pi(\mu)\,\mathcal{L}(x \mid \mu)}{p(x)} \\
                      &= \left\{
                            \begin{array}{lcl}
                              \displaystyle{\frac{(1-w)\phi(x)}{p(x)}}
                                & \mbox{for} & \mu = 0 \\
                              \displaystyle{\frac{w\gamma(\mu)\phi(x-\mu)}{p(x)}}
                                & \mbox{for} & \mu \neq 0. \\
                            \end{array}
                          \right.\\
    \end{align*}
    }
\end{document}

Best Answer

You can use the dcases environment provided by the mathtools package; this environment gives the same output as with cases (from amsmath) except that the rows are set in display style. A little example using the starred version dcases* in which the second column is set in font active just before the environment:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{align*}
  \pi(\mu \mid x) &= \frac{\pi(\mu)\,\mathcal{L}(x \mid \mu)}{p(x)} \\
  &= \begin{dcases*}
    \frac{(1-w)\phi(x)}{p(x)} & for $\mu=0$. \\
    \frac{w\gamma(\mu)\phi(x-\mu)}{p(x)} &for $\mu\neq 0$.
   \end{dcases*}
\end{align*}

\end{document}

enter image description here