我正在尝试将此向量的条目向左对齐。你能帮我吗?下面是我的代码,接下来是结果。
P=\left(\begin{matrix}
p^{(1)}(x_1,x_2,\cdots,x_{r_1}) \\
\vdots\\
p^{(m_1)}(x_1,x_2,\cdots,x_{r_1}) \\
p^{(m_1+1)}(x_1,x_2,\cdots,x_{r_1}, x_{r_1+1},x_{r_1+2},\cdots,x_{r_2}) \\
\vdots\\
p^{(m_2)}(x_{r_1+1},x{r_1+_2},\cdots,x_{r_1}, x_1,x_2,\cdots,x_{r_2}) \\
\end{matrix}\right)
答案1
我假设你喜欢左对齐(现在是矩阵/向量符号的标准。在这种情况下,数组变得方便:
\documentclass{article}
\begin{document}
\[
P=\left(\begin{array}{l}
p^{(1)}(x_1,x_2,\cdots,x_{r_1}) \\
\vdots\\
p^{(m_1)}(x_1,x_2,\cdots, x_{r_1}) \\
p^{(m_1+1)}(x_1,x_2,\cdots,x_{r_1}, x_{r_1+1},x_{r_1+2},\cdots,x_{r_2}) \\
\vdots\\
p^{(m_2)}(x_{r_1+1},x{r_1+_2},\cdots,x_{r_1}, x_1,x_2,\cdots,x_{r_2}) \\
\end{array}\right)
\]
\end{document}
答案2
我建议对@campa 的解决方案进行一些改进,以便更好地对齐垂直点:
\documentclass{article}
\usepackage{mathtools}
\usepackage{eqparbox}
\begin{document}
\[
P=\begin{pmatrix*}[l]
\eqmakebox[P][l]{$ p^{(1)}(x₁,x₂, ⋯ ,x_{r₁}) $} \\
\eqmakebox[P]{$ ⋮ $}\\
\eqmakebox[P]{$ p^{(m₁)}(x₁,x₂, ⋯ ,x_{r₁}) $}\\
p^{(m₁+1)}(x₁,x₂, ⋯ ,x_{r₁}, x_{r₁+1},x_{r₁+2}, ⋯ ,x_{r₂}) \\
\eqmakebox[P]{$ ⋮ $}\\
p^{(m₂)}(x_{r₁+1},x{r₁+₂}, ⋯ ,x_{r₁}, x₁,x₂, ⋯ ,x_{r₂}) \\
\end{pmatrix*}
\]
\end{document}