[Tex/LaTex] Matrix vertical alignment in combination with double spacing

matrices

Why does the following code mess up the vertical alignment in the matrices?

\documentclass{article}

\usepackage{amsmath}
\usepackage{setspace}

\doublespacing

\begin{document}

The first case is
$\left[\begin{matrix} 1 & 2 & 3 \end{matrix}\right]$.

The second case is
$\renewcommand\arraystretch{0.5}\left[\begin{matrix} 1 & 2 & 3 \end{matrix}\right]$.

\end{document}

In the first case, the numbers are clearly too low, and the brackets are too long. This is due to the value of baselinestretch, which I cancel out by taking arraystretch = 1/baselinestretch in the second case. But here, the numbers come out just too high, and moreover the brackets are too long.

How to deal with this?

Best Answer

The matrices are centred rather than aligned on the baseline of a row. You get slightly better spacing if you use bmatrix or with delarray you can align on the top row (but then you don't get theenter image description here spacing adjustments of the AMS version)

\documentclass{article}

\usepackage{amsmath,delarray} 
\usepackage{setspace} 
\doublespacing 
\begin{document} 
The first case is $\left[\begin{matrix} 1 & 2 & 3 \end{matrix}\right]$.

The first case is $\begin{bmatrix} 1 & 2 & 3 \end{bmatrix}$. bm

The first case is $\begin{array}[t]\lbrack{ccc}\rbrack 1 & 2 & 3 \end{array}$. da

The second case is
$\renewcommand\arraystretch{0.5}\left[\begin{matrix} 1 & 2 & 3 \end{matrix}\right]$.

The second case is
$\renewcommand\arraystretch{0.5}\begin{bmatrix} 1 & 2 & 3 \end{bmatrix}$. bm

The second case is
$\renewcommand\arraystretch{0.5}\begin{array}[t]\lbrack{ccc}\rbrack 1 & 2 & 3 \end{array}$. da


\end{document}