我对这两个矩阵的垂直大小有一些问题,如下面的 MWE 代码所示:
\documentclass[11pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{microtype}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{upgreek}
\begin{document}
%\setlength{\abovedisplayskip}{1em}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayskip}{\abovedisplayskip}
\setlength{\belowdisplayshortskip}{\belowdisplayskip}
\setlength{\jot}{3ex}
\begin{align}
A &=
\left[ \begin{array}{c}
\phi \\[3ex]
\displaystyle{\frac{\boldsymbol{\upsigma} \cdot \mathbf{p}}{E + m}} \: \phi
\end{array} \right]
\\
B &=
\left[ \begin{array}{c}
\displaystyle{\frac{\boldsymbol{\upsigma} \cdot \mathbf{p}}{E - m}} \: \chi \\[3ex]
\chi
\end{array} \right]
\end{align}
\end{document}
预览:
矩阵 B 比 A 短,为什么?我想让两个矩阵的大小完全相同。怎么做?
使用矩阵环境没有帮助。
答案1
您tabularray
可以设置行高:
\documentclass[11pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{microtype}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{upgreek}
\usepackage{tabularray}
\UseTblrLibrary{amsmath}
\NewDocumentEnvironment{amatrix}{+b}{
\begin{+bmatrix}[
rowsep=0pt,
rows={ht=6ex},
column{1}={leftsep=4pt},
column{Z}={rightsep=4pt}
]
#1
\end{+bmatrix}%
}{}
\begin{document}
%\setlength{\abovedisplayskip}{1em}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayskip}{\abovedisplayskip}
\setlength{\belowdisplayshortskip}{\belowdisplayskip}
\setlength{\jot}{3ex}
\begin{align}
A &=
\begin{amatrix}
\phi \\
\displaystyle{\frac{\boldsymbol{\upsigma} \cdot \mathbf{p}}{E + m}} \: \phi
\end{amatrix}
\\
B &=
\begin{amatrix}
\displaystyle{\frac{\boldsymbol{\upsigma} \cdot \mathbf{p}}{E - m}} \: \chi \\
\chi
\end{amatrix}
\end{align}
\end{document}