在 LaTeX 中排版大型矩阵
我有一个 3x12 矩阵,我想输入到我的 LaTeX(带有 amsmath)文档中,但是当矩阵大于 3x10 时,LaTeX 似乎会窒息:
\begin{equation}
\textbf{e} =
\begin{bmatrix}
1&1&1&1&0&0&0&0&-1&-1&-1&-1\\
1&-1&0&0&1&1&-1&-1&0&0&1&-1\\
0&0&1&-1&1&-1&1&-1&1&-1&0&0
\end{bmatrix}
\end{equation}
错误:额外对齐选项卡已更改为 \cr。 告诉我,我的 &
数量超出了 bmatrix
环境可以处理的数量。有没有正确的方法来处理这个问题? 1 和 -1 的对齐方式似乎也不同,这也是 bmatrix
所期望的吗?
I have a 3x12 matrix I'd like to input into my LaTeX (with amsmath) document but LaTeX seems to choke when the matrix gets larger than 3x10:
\begin{equation}
\textbf{e} =
\begin{bmatrix}
1&1&1&1&0&0&0&0&-1&-1&-1&-1\\
1&-1&0&0&1&1&-1&-1&0&0&1&-1\\
0&0&1&-1&1&-1&1&-1&1&-1&0&0
\end{bmatrix}
\end{equation}
The error: Extra alignment tab has been changed to \cr. tells me that I have more &
than the bmatrix
environment can handle. Is there a proper way to handle this? It also seems that the alignment for 1's and the -1's are different, is that also expected of the bmatrix
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您来到此页面寻找确切的命令(感谢 Scott Wales 的解答),那么您希望在序言中包含以下内容:
您可以在其中将
20
替换为您想要的最大列数。If you came to this page looking for the exact command (thanks to Scott Wales for the answer), you want this in your preamble:
Where you can replace
20
with the maximum number of columns you want.斯科特的答案是正确的,但我后来了解到您可以覆盖对齐方式。摘自http://texblog.net/latex-archive/maths /matrix-align-left-right/
现在允许命令:
右对齐!
The answer by Scott is correct, but I've since learned you can override the alignment. Taken from http://texblog.net/latex-archive/maths/matrix-align-left-right/
Now allows the command:
to have right-alignment!
您可以使用
tabularray
包中的+bmatrix
来代替bmatrix
:Instead of a
bmatrix
you can use+bmatrix
from thetabularray
package:来自
amsmath
文档 (texdoc amsmath
):即
bmatrix
默认为最多 10 列。脚注添加
From the
amsmath
documentation (texdoc amsmath
):i.e.
bmatrix
defaults to a 10 column maximum.A footnote adds