# Alternative ways to format the cases environment in display math-mode

The cases environment of amsmath package is useful for defining a function that takes different values in different regions. For example:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$f(x) = \begin{cases} g_1(x), & \text{if condition 1}; \\ g_2(x), & \text{if condition 2}; \\ g_3(x), & \text{if condition 3}; \\ g_4(x), & \text{if condition 4}; \\ g_5(x), & \text{if condition 5}; \\ g_6(x), & \text{if condition 6}; \\ g_7(x), & \text{if condition 7}. \\ \end{cases}$$
\end{document}


For such long expressions, the cases environment is easy to read; however, it takes too much vertical space (and for journal and conference papers, space is always at a premium). Is there any alternative way to format such expression that is readable but takes less space than cases environment?

-
If you want to reduce it further you could consider using two columns for the cases, but perhaps that would be too radical of a change... –  Peter Grill Nov 13 '12 at 19:53

cases sets \arraystretch to 1.2. You can decrease this value:

\documentclass{article}
\usepackage{amsmath}
\makeatletter
\def\env@cases{%
\let\@ifnextchar\new@ifnextchar
\left\lbrace
\def\arraystretch{1}%
\makeatother
\begin{document}
$$f(x) = \begin{cases} g_1(x), & \text{if condition 1}; \\ g_2(x), & \text{if condition 2}; \\ g_3(x), & \text{if condition 3}; \\ g_4(x), & \text{if condition 4}; \\ g_5(x), & \text{if condition 5}; \\ g_6(x), & \text{if condition 6}; \\ g_7(x), & \text{if condition 7}. \\ \end{cases}$$
\end{document}


-
Thank you. This does make the output a bit nicer. However, I was wondering if there is a completely different way of visually structuring the content. –  Aditya Jul 10 '12 at 18:15