[Tex/LaTex] Cases environment compresses fractions

cases

what should I do to stop the cases environment compressing the first line of the following?

\begin{equation}
\alpha_{mn} = \begin{cases} \frac{16\mu^2}{mn\pi^2\left[\pi^2(m^2/a^2 + n^2/b^2) - \mu^2\right]} &\mbox{for } m \mbox{ and } n \mbox{ odd;} 
\\ 0 &\mbox{for } m \mbox{ or } n \mbox{ even;} \end{cases} \\[1ex]
\end{equation}

I'm not sure to do tex on this site, but if anyone tries it they see the first case is compressed because it's a fraction.

Best Answer

The package mathtools (that also loads amsmath) provides dcases and dcases*:

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\alpha_{mn} =
\begin{dcases*}
\frac{16\mu^2}{mn\pi^2[\pi^2(m^2/a^2 + n^2/b^2) - \mu^2]} &
  for $m$ and $n$ odd;\\
0\vphantom{\frac{0}{0}} & for $m$ or $n$ even;
\end{dcases*}
\end{equation}
\end{document}

enter image description here

The difference between cases and dcases is that display style is used in the latter, but not in the former. The dcases* form sets the second part in text mode, making it more convenient to type textual conditions.

The \vphantom{\frac{0}{0}} is an adjustment to make the construction more balanced. Note that you don't need \left and \right in the denominator, which would make the brackets too big.

Related Question