Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
\begin{equation}
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{equation}
\end{document}

enter image description here

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?

share|improve this question
1  
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
add comment

1 Answer 1

up vote 8 down vote accepted

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}%
  \array{@{}l@{\quad}l@{}}}
\makeatother
\begin{document}
\begin{equation}
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{equation}
\end{document}

enter image description here

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.