8

The space between two rows seems to differ if the cases environment is used. Have a look at the following example:

enter image description here

\documentclass{minimal}

\begin{document}
\[
\begin{array}{l}
f(x) =%
\begin{dcases}
-1 & x < 0 \\
1 & x > 0
\end{dcases} \\[2em]
g(x) = x \\[2em]
k(x) =%
\begin{dcases}
-1 & x < 0 \\
1 & x > 0
\end{dcases}
\end{array}
\]
\end{document}

I adjust the space between the rows by adding 2em but it looks different. Does someone has an explanation for it?

1
  • @Andrew yes you are right. I changed the title. Thanks for letting me know.
    – Max Maier
    Aug 5, 2013 at 17:22

1 Answer 1

6

array increases the line spacing in a construct such as \\[2em] by adding 2em to its standard strut depth. However, your construction produces something that is deeper than the standard strut already, so the adjustment is not as much as you thought you requested. As you are using dcases which is in mathtools you could, or even should, use an align* environment instead, and that will space correctly.

Sample output

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\verb+array+ example with large depth on lines has a problem:
\[
\begin{array}{l}
  f(x) = \vrule height 2em depth 2em \\[2em]
  g(x) = x \\[2em]
  k(x) = \vrule height 2em depth 2em
\end{array}
\]

The \verb+align*+ version of the original code spaces correctly.

\begin{align*}
  f(x) &=%
  \begin{dcases}
    -1 & x < 0 \\
    1 & x > 0
  \end{dcases} \\[2em]
  g(x) &= x \\[2em]
  k(x) &=%
  \begin{dcases}
    -1 & x < 0 \\
    1 & x > 0
  \end{dcases}
\end{align*}
\end{document}
3
  • Thanks for the explanation! I tried using align* without any luck because I need to left assign the left hand side of each equality. For example, rename the function f(x) to foobar(x). Then g(x) and k(x) should be left assigned. But they aren't -- they are right assigned. This "coding convention" is used throughout our chair. So I have to stick to it. Otherwise I would love to use align*. Do you know if that is possible with the align* environment?
    – Max Maier
    Aug 5, 2013 at 17:28
  • After searching a bit I found the following SX-Entry which solves my problem by using alignat: tex.stackexchange.com/questions/10446/…
    – Max Maier
    Aug 5, 2013 at 19:10
  • To left align as in your array example, just write the & at the beginning of each line instead of before the =, &f(x) = ... etc. Aug 5, 2013 at 19:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .