我目前正在尝试排版 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}
但是,行距看起来有点太小了,所以我想
\begin{center}\setstretch{1.5}\par
...
\end{center}
和我预期的不太一样。现在,我想我可以像这样修复它:
\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}
但这只会让一切回到我开始的地方。有什么建议可以让我增加行距而不弄乱矩阵中的行距吗?
编辑:这不是重复的减少矩阵中的行距,因为我实际上想保持矩阵中的行间距不变,同时增加周围文本的行间距。
答案1
setspace
如果由于机构的具体指示而没有强制您使用它,请避免使用它。
这里您只需要一个标准amsmath
环境,并借助一些帮助在行间提供更多的空间。
\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}
只是为了好玩,这里有一个我们让 LaTeX 进行居中的解决方案:
\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}
答案2
这是一个使用环境的解决方案。还请注意,3x3 矩阵的环境align*
的使用以及将三个主要行之间的垂直空间增加。pmatrix*
[2ex]
2ex
\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}