我有两个向量 y 和 b,一个在另一个之上。我希望将这两个向量放在同一行,以便节省文档中的页面。
\begin{align*}
y = \begin{pmatrix}
a_{0}\\
a_{1}\\
a_{2}\\
\vdots \\
a_{p}\\
c_{1}\\
c_{2}\\
\vdots \\
c_{m}\\
\end{pmatrix} \in \mathbb{R}^{(m+p+1)}
\end{align*}
\begin{align*}
b = \begin{pmatrix}
f_{0}\\
f_{1}\\
f_{2}\\
\vdots \\
f_{n}\\
\end{pmatrix} \in \mathbb{R}^{(n+1)}
\end{align*}
答案1
您应该使用单一equation*
环境(使用align
仅有的当涉及对齐时,正如已经建议的那样。
不过,还有其他节省空间的选择。
\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
\begin{equation*}
y =
\begin{pmatrix}
a_{0}\\
a_{1}\\
a_{2}\\
\vdots \\
a_{p}\\
c_{1}\\
c_{2}\\
\vdots \\
c_{m}
\end{pmatrix} \in \mathbb{R}^{(m+p+1)}
\quad\text{and}\quad
b =
\begin{pmatrix}
f_{0}\\
f_{1}\\
f_{2}\\
\vdots \\
f_{n}\\
\end{pmatrix} \in \mathbb{R}^{(n+1)}
\end{equation*}
But, if you really want to save space, you can use an alignment
\begin{align*}
y &=
\begin{pmatrix}
a_{0} &
a_{1} &
a_{2} &
\cdots &
a_{p} &
c_{1} &
c_{2} &
\cdots &
c_{m}
\end{pmatrix}^{T} \in \mathbb{R}^{(m+p+1)}
\\
b &=
\begin{pmatrix}
f_{0} &
f_{1} &
f_{2} &
\cdots &
f_{n}
\end{pmatrix}^T \in \mathbb{R}^{(n+1)}
\end{align*}
or center both vectors
\begin{gather*}
y =
\begin{pmatrix}
a_{0} &
a_{1} &
a_{2} &
\cdots &
a_{p} &
c_{1} &
c_{2} &
\cdots &
c_{m}
\end{pmatrix}^{T} \in \mathbb{R}^{(m+p+1)}
\\
b =
\begin{pmatrix}
f_{0} &
f_{1} &
f_{2} &
\cdots &
f_{n}
\end{pmatrix}^T \in \mathbb{R}^{(n+1)}
\end{gather*}
\end{document}
答案2
像这样吗?
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\begin{document}
\begin{equation*}
\mathbf{y} = \begin{pmatrix}
a_{0}\\
a_{1}\\
a_{2}\\
\vdots \\
a_{p}\\
c_{1}\\
c_{2}\\
\vdots \\
c_{m}\\
\end{pmatrix} \in \mathbb{R}^{(m+p+1)}, \qquad
\mathbf{b} = \begin{pmatrix}
f_{0}\\
f_{1}\\
f_{2}\\
\vdots \\
f_{n}\\
\end{pmatrix} \in \mathbb{R}^{(n+1)}
\end{equation*}
\end{document}