原 文:Matrices
譯 者:Xovee
翻譯時間:2020年6月21日
Matrices
amsmath
矩陣環境
amsmath
包提供了許多輸入矩陣的命令。在文檔的序言中引入 \usepackage{amsmath}
包之後,你就可以使用下面的各種數學環境:
類型 | LaTeX 標記 | 輸出 |
---|---|---|
普通 | \begin{matrix} 1 & 2 & 3\ a & b & c \end{matrix} |
|
括號;圓括號 | \begin{pmatrix} 1 & 2 & 3\ a & b & c \end{pmatrix} |
|
方括號 | \begin{bmatrix} 1 & 2 & 3\ a & b & c \end{bmatrix} |
|
大括號 | \begin{Bmatrix} 1 & 2 & 3\ a & b & c \end{Bmatrix} |
|
直線 | \begin{vmatrix} 1 & 2 & 3\ a & b & c \end{vmatrix} |
|
雙直線 | \begin{Vmatrix} 1 & 2 & 3\ a & b & c \end{Vmatrix} |
如果你需要創建更多類型的矩陣,例如使用不同的分隔符,你可以手動控制它的樣式,例如:
LaTeX 標記 | 輸出 |
---|---|
\left\lceil \begin{matrix} 1 & 2 & 3\ a & b & c \end{matrix} \right\rceil |
|
\left\langle \begin{matrix} 1 & 2 & 3\ a & b & c \end{matrix} \right\rangle |
行內矩陣
在輸入行內公式時,使用傳統的矩陣環境可能看起來過於大了。你可以使用smallmatrix
環境來創建小一點的矩陣。
Trying to typeset an inline matrix here
$\begin{pmatrix}
a & b\\
c & d
\end{pmatrix}$
but it looks too big, so let's try
$\big(\begin{smallmatrix}
a & b\\
c & d
\end{smallmatrix}\big)$
instead.
mathtools
包提供了一些使用起來更方便的環境,例如 psmallmatrix
、bsmallmatrix
等。