Math & ScienceSet vertical Spacing of Cases globally

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
User avatar
Lucas Malor
Posts: 14
Joined: Fri Feb 03, 2012 4:05 pm

Set vertical Spacing of Cases globally

Post by Lucas Malor »

If I write a case with fractions within, the lines of equation overlaps, and the vertical space is few without fractions too IMHO.
I added additional vertical space for all the other multiline environments via \jot and \arraystrecth, but how can I set vertical spacing for all cases?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Set vertical Spacing of Cases globally

Post by Stefan Kottwitz »

Hi Lucas,

cases uses a fixed arraystretch value of 1.2 internally. Here's a redefinition, showing how you optionally can change it:

Code: Select all

Code, edit and compile here:
\makeatletter
\renewcommand*\env@cases[1][1.2]{%
\let\@ifnextchar\new@ifnextchar
\left\lbrace
\def\arraystretch{#1}%
\array{@{}l@{\quad}l@{}}%
}
\makeatother
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
If you need it globally, just change the default value of 1.2 for the optional argument above.

I posted this solution earlier on my blog, with more explanation: amsmath: cases and \arraystretch.

Stefan
LaTeX.org admin
User avatar
Lucas Malor
Posts: 14
Joined: Fri Feb 03, 2012 4:05 pm

Re: Set vertical Spacing of Cases globally

Post by Lucas Malor »

Wonderful, it works. I read cases with 1.4 a lot better. Thank you.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Set vertical Spacing of Cases globally

Post by localghost »

Take a look at the mathtools package. It offers several similar environments with enhancements.


Best regards and welcome to the board
Thorsten
User avatar
Lucas Malor
Posts: 14
Joined: Fri Feb 03, 2012 4:05 pm

Re: Set vertical Spacing of Cases globally

Post by Lucas Malor »

It seems interesting, but unlyckily I already submitted my work. If I need it in a future I'll try it. Thank you.
Post Reply