2

I'm currently trying to typeset the Gell-Mann-Matrices:

\documentclass{article}
\usepackage{array}
\usepackage{setspace}

\newcommand\matthree[9]{\left(\begin{array}{c c c} #1 & #2 & #3 \\ #4 & #5 & #6 \\ #7 & #8 & #9\end{array}\right)}

\begin{document}

The generators are often written in a standard basis
$T^a = \frac{1}{2} \lambda^a$, with $\lambda^a$ being the Gell-Mann-Matrices

\begin{center}
  $\lambda^1 = \matthree {0}{1}{}{1}{0}{}{}{}{0}$,
  $\lambda^2 = \matthree {0}{-i}{}{i}{0}{}{}{}{0}$,
  $\lambda^3 = \matthree {1}{}{}{}{-1}{}{}{}{0}$,
  $\lambda^4 = \matthree {0}{}{1}{}{0}{}{1}{}{0}$,
  $\lambda^5 = \matthree {0}{}{-i}{}{0}{}{i}{}{0}$,
  $\lambda^6 = \matthree {0}{}{}{}{0}{1}{}{1}{0}$,
  $\lambda^7 = \matthree {0}{}{}{}{0}{-i}{}{i}{0}$,
  $\lambda^8 = \frac{1}{\sqrt{3}} \matthree {1}{}{}{}{1}{}{}{}{-2}$ 
\end{center}

\end{document}

This already looks fairly reasonable: standard

However, the line spacing looks a bit too small, so I thought I'd go for

\begin{center}\setstretch{1.5}\par
   ...
\end{center}

stretched

Not quite what I expected. Now, I thought I might be able to fix it like this:

\newcommand\matthree[9]{\begingroup\setstretch{1.0}\left(\begin{array}{c c c} #1 & #2 & #3 \\ #4 & #5 & #6 \\ #7 & #8 & #9\end{array}\right)\endgroup}

But this just turns everything back to where I started. Any suggestions on how I can increase the line spacing without messing with the row spacing in the matrices?

EDIT: This is not a duplicate of reducing row spacing in a matrix, because I actually want to keep the row spacing in a matrix constant while increasing the line spacing of the surrounding text.

carsten
  • 2,966
  • I would not recommend doing this in \textstyle math, but rather \displaystyle. Nonetheless, your 1st MWE can be made to follow your wishes by adding \bigskip and a blank line after the 3rd and the 6th matrices. Also, \quad spacing between individual equations (i.e., following the comma) is customary. – Steven B. Segletes Oct 18 '16 at 17:04
  • @egreg - I think that what the OP is really trying to achieve is to increase the vertical space between the three main rows, rather than decrease (or increase...) the vertical space within a given 3x3 matrix. At any rate, one should use a displaymath environment such as gather* instead of a center environment for the material at hand. – Mico Oct 18 '16 at 17:13
  • I agree that there are probably nicer ways of typesetting this than using center, but I'd still like to have a way to locally change line spacing without affecting the array row spacing. Also, @egreg's suggestion of cancelling the stretch by an additional factor in the preamble doesn't work for me because I don't want to change the spacing globally, only for this one segment of the document. – carsten Oct 18 '16 at 17:19
  • @egreg: in order to clarify where I applied the \setstretch, I edited the question. – carsten Oct 18 '16 at 17:24
  • It should be \setstretch{1.5}\selectfont, not \par. But there are better solutions. – egreg Oct 18 '16 at 17:37

2 Answers2

2

Here's a solution that uses an align* environment. Note also the use of a pmatrix* environment for the 3x3 matrices and of [2ex] to increase the vertical space between the three main rows by 2ex.

enter image description here

\documentclass{article}
\usepackage{mathtools} % for 'pmatrix*' env.
\newcommand\matthree[9]{%
     \begin{pmatrix*}[r]
         #1 & #2 & #3 \\ 
         #4 & #5 & #6 \\ 
         #7 & #8 & #9
     \end{pmatrix*}}

\begin{document}
\noindent
Using an \verb+align*+ environment:
\begin{align*}
  \lambda^1 &= \matthree {0}{1}{}{1}{0}{}{}{}{0} &
  \lambda^2 &= \matthree {0}{-i}{}{i}{0}{}{}{}{0}&
  \lambda^3 &= \matthree {1}{}{}{}{-1}{}{}{}{0}  \\[2ex]
  \lambda^4 &= \matthree {0}{}{1}{}{0}{}{1}{}{0} &
  \lambda^5 &= \matthree {0}{}{-i}{}{0}{}{i}{}{0}&
  \lambda^6 &= \matthree {0}{}{}{}{0}{1}{}{1}{0} \\[2ex]
  \lambda^7 &= \matthree {0}{}{}{}{0}{-i}{}{i}{0}&
  \lambda^8 &= \frac{1}{\sqrt{3}} \matthree {1}{}{}{}{1}{}{}{}{-2} 
\end{align*}
\end{document}
Mico
  • 506,678
1

Avoid setspace, if you are not compelled to use it because of institution specific instructions.

Here you just need a standard amsmath environment, with some help for giving more room between rows.

\documentclass{article}
\usepackage{amsmath}

\newcommand\matthree[9]{%
  \begin{pmatrix}
  #1 & #2 & #3 \\ #4 & #5 & #6 \\ #7 & #8 & #9
  \end{pmatrix}%
}

\begin{document}

The generators are often written in a standard basis
$T^a = \frac{1}{2} \lambda^a$, with $\lambda^a$ being the Gell-Mann-Matrices
\begin{gather*}
\lambda^1 = \matthree {0}{1}{}{1}{0}{}{}{}{0},\quad
\lambda^2 = \matthree {0}{-i}{}{i}{0}{}{}{}{0},\quad
\lambda^3 = \matthree {1}{}{}{}{-1}{}{}{}{0},\\[1ex]
\lambda^4 = \matthree {0}{}{1}{}{0}{}{1}{}{0},\quad
\lambda^5 = \matthree {0}{}{-i}{}{0}{}{i}{}{0},\quad
\lambda^6 = \matthree {0}{}{}{}{0}{1}{}{1}{0},\\[1ex]
\lambda^7 = \matthree {0}{}{}{}{0}{-i}{}{i}{0},\quad
\lambda^8 = \frac{1}{\sqrt{3}} \matthree {1}{}{}{}{1}{}{}{}{-2}
\end{gather*}

\end{document}

enter image description here

Just for fun, here's a solution where we let LaTeX do the centering:

\documentclass{article}
\usepackage{amsmath}

\newcommand\matthree[9]{%
  \begin{pmatrix}
  #1 & #2 & #3 \\ #4 & #5 & #6 \\ #7 & #8 & #9
  \end{pmatrix}%
}

\begin{document}

The generators are often written in a standard basis
$T^a = \frac{1}{2} \lambda^a$, with $\lambda^a$ being the Gell-Mann-Matrices
\[
\begin{minipage}{.75\displaywidth}
\centering\setlength{lineskip}{2ex}
$\lambda^1 = \matthree {0}{1}{}{1}{0}{}{}{}{0}$,
$\lambda^2 = \matthree {0}{-i}{}{i}{0}{}{}{}{0}$,
$\lambda^3 = \matthree {1}{}{}{}{-1}{}{}{}{0}$,
$\lambda^4 = \matthree {0}{}{1}{}{0}{}{1}{}{0}$,
$\lambda^5 = \matthree {0}{}{-i}{}{0}{}{i}{}{0}$,
$\lambda^6 = \matthree {0}{}{}{}{0}{1}{}{1}{0}$,
$\lambda^7 = \matthree {0}{}{}{}{0}{-i}{}{i}{0}$,
$\lambda^8 = \frac{1}{\sqrt{3}} \matthree {1}{}{}{}{1}{}{}{}{-2}$
\end{minipage}
\]

\end{document}
egreg
  • 1,121,712