我正在写一些计量经济学的讲义,我想听听您的建议,如何在两个矩阵之间插入一些垂直空间,以便更容易理解结果。
以下是一个最简单的例子:
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\begin{align*}
Var(u) &= E(uu') = \\
&= E
\begin{bmatrix}
u_1 u_1' & u_1 u_2' & \cdots & u_1 u_M' \\
u_2 u_1' & u_2 u_2' & \cdots & u_2 u_M' \\
\vdots & & \ddots & \vdots \\
u_M u_1' & u_M u_2' & \cdots & u_M u_M '
\end{bmatrix}
=
\begin{bmatrix}
\sigma_{11} I & \sigma_{12} I & \cdots & \sigma_{1M} I \\
\sigma_{12} I & \sigma_{22} I & \cdots & \sigma_{2M} I \\
\vdots & & \ddots & \vdots\\
\sigma_{1n} I & \sigma_{2M} I & \cdots & \sigma_{MM} I
\end{bmatrix} \\
&=
\begin{pmatrix}
\sigma_{11} & \sigma_{12} & \cdots & \sigma_{1M} \\
\sigma_{12} & \sigma_{22} & \cdots & \sigma_{2M} \\
\vdots & & \ddots & \vdots \\
\sigma_{1M} & \sigma_{2M} & \cdots & \sigma_{MM}
\end{pmatrix} \otimes I_T
\end{align*}
\end{document}
答案1
为了说明@JohnKormylo 的评论,您需要将其放在已有的 \\ 位置。更改您的 MWE(间隙为 10pt):
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\begin{align*}
Var(u) &= E(uu') = \\
&= E
\begin{bmatrix}
u_1 u_1' & u_1 u_2' & \cdots & u_1 u_M' \\
u_2 u_1' & u_2 u_2' & \cdots & u_2 u_M' \\
\vdots & & \ddots & \vdots \\
u_M u_1' & u_M u_2' & \cdots & u_M u_M '
\end{bmatrix}
=
\begin{bmatrix}
\sigma_{11} I & \sigma_{12} I & \cdots & \sigma_{1M} I \\
\sigma_{12} I & \sigma_{22} I & \cdots & \sigma_{2M} I \\
\vdots & & \ddots & \vdots\\
\sigma_{1n} I & \sigma_{2M} I & \cdots & \sigma_{MM} I
\end{bmatrix} \\[10pt] %%%%%%%%%%%%%%%%% Change this for different spacing
&=
\begin{pmatrix}
\sigma_{11} & \sigma_{12} & \cdots & \sigma_{1M} \\
\sigma_{12} & \sigma_{22} & \cdots & \sigma_{2M} \\
\vdots & & \ddots & \vdots \\
\sigma_{1M} & \sigma_{2M} & \cdots & \sigma_{MM}
\end{pmatrix}_{\otimes I_T}
\end{align*}
\end{document}\documentclass[]{article}
\begin{document}
\title{Title}
\author{Author}
\date{Today}
\maketitle
Content
\end{document}
答案2
\\
您可以通过将后面的内容改为\end{bmatrix}
来添加空格\\[1em]
,其中1em
的长度可以是任意的。在您的示例中:
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\begin{align*}
Var(u) &= E(uu') = \\[1em]
&= E
\begin{bmatrix}
u_1 u_1' & u_1 u_2' & \cdots & u_1 u_M' \\
u_2 u_1' & u_2 u_2' & \cdots & u_2 u_M' \\
\vdots & & \ddots & \vdots \\
u_M u_1' & u_M u_2' & \cdots & u_M u_M '
\end{bmatrix}
=
\begin{bmatrix}
\sigma_{11} I & \sigma_{12} I & \cdots & \sigma_{1M} I \\
\sigma_{12} I & \sigma_{22} I & \cdots & \sigma_{2M} I \\
\vdots & & \ddots & \vdots\\
\sigma_{1n} I & \sigma_{2M} I & \cdots & \sigma_{MM} I
\end{bmatrix} \\[1em]
&=
\begin{pmatrix}
\sigma_{11} & \sigma_{12} & \cdots & \sigma_{1M} \\
\sigma_{12} & \sigma_{22} & \cdots & \sigma_{2M} \\
\vdots & & \ddots & \vdots \\
\sigma_{1M} & \sigma_{2M} & \cdots & \sigma_{MM}
\end{pmatrix}_{\otimes I_T}
\end{align*}
\end{document}
答案3
以下是我的做法:
\documentclass{article}
\usepackage{mathtools}
\DeclareMathOperator*{\Var}{Var}
\begin{document}
\begin{align*}
\Var(u)
&= E(uu') \\[1ex]
&= E {\mkern -4mu}
\begin{bmatrix}
u_{1}u_{1}' & u_{1}u_{2}' & \cdots & u_{1}u_{M}' \\
u_{2}u_{1}' & u_{2}u_{2}' & \cdots & u_{2}u_{M}' \\
\vdots & & \ddots & \vdots \\
u_{M}u_{1}' & u_{M}u_{2}' & \cdots & u_{M}u_{M}'
\end{bmatrix} \\[1ex]
&= {\mkern -6mu}
\begin{bmatrix}
\sigma_{11}I & \sigma_{12}I & \cdots & \sigma_{1M}I \\
\sigma_{12}I & \sigma_{22}I & \cdots & \sigma_{2M}I \\
\vdots & & \ddots & \vdots \\
\sigma_{1M}I & \sigma_{2M}I & \cdots & \sigma_{MM}I
\end{bmatrix} \\[1ex]
&= {\mkern -6mu}
\begin{pmatrix}
\sigma_{11} & \sigma_{12} & \cdots & \sigma_{1M} \\
\sigma_{12} & \sigma_{22} & \cdots & \sigma_{2M} \\
\vdots & & \ddots & \vdots \\
\sigma_{1M} & \sigma_{2M} & \cdots & \sigma_{MM}
\end{pmatrix}_{\mkern -4mu \otimes I_{T}}
\end{align*}
\end{document}
请注意使用 的水平间距改进\mkern
。
PS 我认为在这种情况下两个矩阵在同一行上看起来不太好。