# vertical spacing in array with double-spacing

Double-spacing seems to mess up the vertical spacing inside of arrays. For example, the braces below extend too high. Is there a way to have the array contents centered vertically within the braces?

\documentclass{article}
\usepackage[doublespacing]{setspace}
\begin{document}
$\left\{ \begin{array}{c} abcde \\ abcde \end{array} \right\}$
\end{document}


The problem gets more obvious as the line spacing increases. For example, compare the space above the first line with the space below the second one:

\documentclass{article}
\begin{document}
\renewcommand\arraystretch{3}
$\left\{\begin{array}{c} abcde \\ abcde \end{array} \right\}$
\end{document}


-

easiest (tested with the MWE, I didn't try your thesis class) is to add

\renewcommand\arraystretch{0.7}


to the preamble of the document.

-
Thanks, I tried this as well. It's a good way of obscuring the problem (by condensing everything vertically), but the underlying asymmetry is still there. Specifically, there is still more space above the text than below it. By comparison, \renewcommand\arraystretch{1.5} makes the underlying problem more apparent. –  Noah Dec 16 '12 at 20:54
There is more space above than below in standard latex without any double spacing, as arrays are designed to give even line spacing in normal situations, so every line has a \strut an invisible rule, so there is enough space above the baseline of each row for a construct such as (A) with a bracketed capital, and your example has just lower case. –  David Carlisle Dec 16 '12 at 21:12
Ah, thank you for the explanation. I see the logic behind equal line spacing in arrays, and for leaving enough room for a bracketed capital like (A). However, there still seems to be an inordinate amount of space above when the line spacing is large. For example, try the following: \renewcommand\arraystretch{4} $\left\{ \begin{array}{c}(Aq) \\ (Aq) \end{array} \right\}$ Is there a simple way to decrease the space above the array lines without affecting the space below? The best I've come up with is raising each line with \raisebox. –  Noah Dec 17 '12 at 1:25
arraystretch just multiplies the height and depth of the strut in equal proportion so normally there is roughly .7 baselineskip height and .3 depth so if you multiply by 4 there is 2.8 baselineskip height and 1.2 baselineskip depth –  David Carlisle Dec 17 '12 at 9:23

I would really avoid using such monsters inline. As you can see not only it messes up the spacing but also eyes get misty while reading it. Use a smallmatrix instead.

\documentclass{article}
\usepackage{amsmath}
\usepackage[doublespacing]{setspace}
\begin{document}
Lorem ipsum and you know $\left\{ \begin{smallmatrix} abcde \\ abcde \end{smallmatrix} \right\}$
oh and a small matrix. I'm getting better at making up stupid sentences (or I
was until the last one).
$\left\{ \begin{array}{c} abcde \\ abcde \end{array} \right\}$
It might speak for itself.

\end{document}


-
Thanks for pointing out the smallmatrix command. However, I do want double-spacing within the array. I want to avoid the problem that as line spacing increases the space above each line gets bigger than the space below. –  Noah Dec 17 '12 at 15:58
@Noah Well you've been warned. It's actually trying to help you but you want to break and fix at the same time. Nevertheless here is something related: tex.stackexchange.com/questions/19457/… –  percusse Dec 17 '12 at 16:02

I can get the output I want by manually removing space before the first array line, as follows. However this solution requires re-calculating the amount of space to remove with any change in line spacing.

\documentclass{article}
\usepackage[doublespacing]{setspace}
\begin{document}
$\left\{ \begin{array}{c} \\[-2.3em] abcde \\ abcde \end{array} \right\}$
\end{document}


-

I've adapted Hendrik Vogt's solution here as follows. (He also has a clearer discussion of the problem.)

\documentclass{article}
\usepackage[doublespacing]{setspace}
\usepackage{amsmath,etoolbox}
\makeatletter
\newif\ifcenter@asb@\center@asb@false
\def\center@arstrutbox{%
\setbox\@arstrutbox\hbox{$\vcenter{\box\@arstrutbox}$}%
}
\newcommand*{\CenteredArraystretch}[1]{%
\ifcenter@asb@\else
\pretocmd{\@mkpream}{\center@arstrutbox}{}{}%
\center@asb@true
\fi
\renewcommand{\arraystretch}{#1}%
}
\makeatother
\CenteredArraystretch{1}
\begin{document}
$\left\{ \begin{array}{c} abcde \\ abcde \end{array} \right\}$
\end{document}

-