TeXblog

 Typography with TeX and LaTeX

amsmath: cases and \arraystretch

24 September 2008 by Stefan Kottwitz

The amsmath cases environment is using the array environment internally, like its matrix environments. If you want to change the interline spacing of matrices you could redefine \arraystretch, like for any array environment. But it won’t work for cases - amsmath defines an arraystretch value of 1.2 internally.

A solution is to redefine the \env@cases macro. Here’s a redefinition, introducing an optional parameter controlling the spacing:

\makeatletter
\renewcommand*\env@cases[1][1.2]{%
  \let\@ifnextchar\new@ifnextchar
  \left\lbrace
  \def\arraystretch{#1}%
  \array{@{}l@{\quad}l@{}}%
}
\makeatother

Now by \begin{cases} … \end{cases} the default value of 1.2 will be used, but by using the optional parameter like \begin{cases}[0.8] … \end{cases} the spacing will be adjusted accordingly.

This topic was discussed on mrunix.de.

This entry was posted on 24 September 2008 at 10:25 PM and is filed under Mathematics. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 responses about “amsmath: cases and \arraystretch”

  1. Tom said:

    “it’s”?

    Otherwise nice post, thanks.

  2. Stefan Kottwitz said:

    Hi Tom,

    thank you for pointing out the typo in the first sentence, I’ve changed it to “its”, meaning the matrix environments of amsmath.

Leave a Reply