我正在尝试在一系列定义的矩阵中间换行。代码如下:
\begin{equation}
I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix},
X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix},
Y = \begin{pmatrix} 0 & \imath \\ -\imath & 0 \end{pmatrix}, \\
Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},
H = \frac{1}{\sqrt2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix},
S = \begin{pmatrix} 1 & 0 \\ 0 & \imath \end{pmatrix}.
\end{equation}
然而矩阵都出现在一行中。
答案1
详细说明 Argos 的建议。在这种情况下,我会使用
\begin{gather*}
I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \quad
X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \quad
Y = \begin{pmatrix} 0 & \imath \\ -\imath & 0 \end{pmatrix}, \\
Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}, \quad
H = \frac{1}{\sqrt2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, \quad
S = \begin{pmatrix} 1 & 0 \\ 0 & \imath \end{pmatrix}.
\end{gather*}
没有编号,空间更好
对齐和单个数字
\begin{gather}
\begin{aligned}
I &= \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix},
& % seperation
X &= \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix},
&
Y &= \begin{pmatrix} 0 & \imath \\ -\imath & 0 \end{pmatrix},
\\
Z &= \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},
&
H &= \frac{1}{\sqrt2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix},
&
S &= \begin{pmatrix} 1 & 0 \\ 0 & \imath \end{pmatrix}.
\end{aligned}
\end{gather}
amsmath
详情请参阅手册
这两个示例如下所示:
答案2
尝试使用多行方程align
包AMS-math
,这容易得多。
\begin{align}
I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix},
X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix},
Y = \begin{pmatrix} 0 & \imath \\ -\imath & 0 \end{pmatrix}, \\
Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},
H = \frac{1}{\sqrt2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix},
S = \begin{pmatrix} 1 & 0 \\ 0 & \imath \end{pmatrix}.
\end{align}