如何将一组对齐的块水平居中,所有块都位于单个编号的块内?
下面,我想将第一行和包含第二行和第三行的块居中。
\documentclass[10pt]{report}
\usepackage{amsthm,amsmath,amssymb,showframe}
\begin{document}
\begin{equation}
\begin{split}
\begin{aligned}
e_{0}^{2} &= e_{0}, &
e_{1}^{2} &= -e_{0}, &
e_{2}^{2} &= -e_{0}, &
e_{3}^{2} &= -e_{0},
\end{aligned}\\
\begin{aligned}
e_{0}\cdot e_{1}= e_{1}\cdot e_{0} &= e_{1}, &
e_{0}\cdot e_{2}= e_{2}\cdot e_{0} &= e_{2}, &
e_{0}\cdot e_{3}= e_{3}\cdot e_{0} &= e_{3}, \\
e_{1}\cdot e_{2}= -e_{2}\cdot e_{1} &= e_{3}, &
e_{2}\cdot e_{3}= -e_{3}\cdot e_{2} &= e_{1}, &
e_{3}\cdot e_{1}= -e_{1}\cdot e_{3} &= e_{2}.
\end{aligned}
\end{split}
\end{equation}
\end{document}
答案1
我会使用gathered
嵌套的aligned
;在后一种环境中,我会使用第一个=
来设置对齐方式,而不是最后一个。
\documentclass[10pt]{report}
\usepackage{amsthm,amsmath,amssymb,showframe}
\begin{document}
\begin{equation}
\begin{gathered}
e_{0}^{2} = e_{0},\quad
e_{1}^{2} = -e_{0},\quad
e_{2}^{2} = -e_{0},\quad
e_{3}^{2} = -e_{0},
\\
\begin{aligned}
e_{0}\cdot e_{1} &= e_{1}\cdot e_{0} = e_{1}, &
e_{0}\cdot e_{2} &= e_{2}\cdot e_{0} = e_{2}, &
e_{0}\cdot e_{3} &= e_{3}\cdot e_{0} = e_{3}, \\
e_{1}\cdot e_{2} &= -e_{2}\cdot e_{1} = e_{3}, &
e_{2}\cdot e_{3} &= -e_{3}\cdot e_{2} = e_{1}, &
e_{3}\cdot e_{1} &= -e_{1}\cdot e_{3} = e_{2}.
\end{aligned}
\end{gathered}
\end{equation}
\end{document}
但这个\cdot
符号似乎是多余的。
\documentclass[10pt]{report}
\usepackage{amsthm,amsmath,amssymb,showframe}
\begin{document}
\begin{equation}
\begin{gathered}
e_{0}^{2} = e_{0},\quad
e_{1}^{2} = -e_{0},\quad
e_{2}^{2} = -e_{0},\quad
e_{3}^{2} = -e_{0},
\\
\begin{aligned}
e_{0} e_{1} &= e_{1} e_{0} = e_{1}, &
e_{0} e_{2} &= e_{2} e_{0} = e_{2}, &
e_{0} e_{3} &= e_{3} e_{0} = e_{3}, \\
e_{1} e_{2} &= -e_{2} e_{1} = e_{3}, &
e_{2} e_{3} &= -e_{3} e_{2} = e_{1}, &
e_{3} e_{1} &= -e_{1} e_{3} = e_{2}.
\end{aligned}
\end{gathered}
\end{equation}
\end{document}
答案2
不完全符合要求(没有对齐),但这可以令人满意吗?
\documentclass[10pt]{report}
%\usepackage{amsthm,amsmath,amssymb,showframe}
\usepackage{amsthm,mathtools,amssymb}
\begin{document}
\begin{equation}
\begin{gathered}
e_{0}^{2} = e_{0}, \quad
e_{1}^{2} = -e_{0}, \quad
e_{2}^{2} = -e_{0}, \quad
e_{3}^{2} = -e_{0}, \\
e_{0}\cdot e_{1}= e_{1}\cdot e_{0} = e_{1}, \quad
e_{0}\cdot e_{2}= e_{2}\cdot e_{0} = e_{2}, \quad
e_{0}\cdot e_{3}= e_{3}\cdot e_{0} = e_{3}, \\
e_{1}\cdot e_{2}= -e_{2}\cdot e_{1} = e_{3}, \quad
e_{2}\cdot e_{3}= -e_{3}\cdot e_{2} = e_{1}, \quad
e_{3}\cdot e_{1}= -e_{1}\cdot e_{3} = e_{2}.
\end{gathered}
\end{equation}
\end{document}
需要mathtools
(对于gathered
环境),它会加载amsmath
。