2010-05-07 36 views
11

大矩陣我有一個3x12矩陣我想投入我的乳膠(與amsmath)文檔,但乳膠似乎當矩陣變得大於3×嗆:排版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的?

回答

19

amsmath文檔(texdoc amsmath):

The amsmath package provides some environments for matrices beyond the basic array environment of LATEX. The pmatrix, bmatrix, Bmatrix, vmatrix and Vmatrix have (respectively) (), [ ], { }, | |, and ∥ ∥ delimiters built in. For naming consistency there is a matrix environment sans delimiters. This is not entirely redundant with the array environment; the matrix environments all use more economical horizontal spacing than the rather prodigal spacing of the array environment. Also, unlike the array environment, you don’t have to give column specifications for any of the matrix environments; by default you can have up to 10 centered columns. (If you need left or right alignment in a column or other special formats you must resort to array.)

bmatrix默認爲10列最大。

腳註增加

More precisely: The maximum number of columns in a matrix is determined by the counter MaxMatrixCols (normal value = 10), which you can change if necessary using LATEX’s \setcounter or \addtocounter commands.

+0

精彩!這正是我所期待的,我沒有意識到可以改變列的最大值。至於右對齊方式,我已經找到了一個很好的解決方法,它仍然允許bmatrix命令 - 我會將它發佈在我自己的解決方案中。 – Hooked 2010-05-07 15:51:13

+0

我有完全相同的問題,好問題!我在表示理論中計算字符表,即使是相當小的組,您也很容易用大矩陣結束。感謝您發佈/回答這個問題! – 2012-03-25 18:13:43

1

斯科特的答案是正確的,但我已經學會了,因爲你可以覆蓋對齊。從http://texblog.net/latex-archive/maths/matrix-align-left-right/

\makeatletter 
\renewcommand*\[email protected][1][c]{\hskip -\arraycolsep 
    \let\@ifnextchar\[email protected] 
    \array{*\[email protected] #1}} 
\makeatother 

採取現在允許命令:

\begin{bmatrix}[r] .... 

有右對齊!

+0

我相信你也可以只用'bmatrix *'環境從'mathtools'包來實現同樣的事情,至少根據維基: http://en.wikibooks.org/wiki/LaTeX/Mathematics# Matrices_and_arrays – 2012-11-25 00:34:49