Linear Algebra

Vectors, matrices, transposes, at inner products.

Linear algebra symbols in LaTeX: matrices, vectors, transpose and norms

Linear algebra in LaTeX starts with the matrix environments from amsmath: pmatrix for round brackets, bmatrix for square ones and vmatrix for a determinant. A vector is \mathbf{v} or \vec{v}, the transpose is A^\top (or A^T), the inverse A^{-1}, the conjugate transpose A^\dagger, and the norm \|x\|. The determinant \det is built in, while trace and rank are best written with \operatorname{tr} and \operatorname{rank}. The table lists the linear algebra symbols people use most, with the package each one needs; the full list follows below.

Quick reference: matrices, vectors and operations

SymbolCommandUsePackageCopy
(abcd)\begin{pmatrix} a & b \\ c & d \end{pmatrix}
\begin{pmatrix} a & b \\ c & d \end{pmatrix}Matrix in parenthesesamsmath
[1001]\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}
\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}Matrix in square bracketsamsmath
∣abcd∣\begin{vmatrix} a & b \\ c & d \end{vmatrix}
\begin{vmatrix} a & b \\ c & d \end{vmatrix}Determinant barsamsmath
v\mathbf{v}
\mathbf{v}Bold vectorbuilt in
v⃗\vec{v}
\vec{v}Vector with an arrowbuilt in
A⊤A^\top
A^\topTransposebuilt in
A−1A^{-1}
A^{-1}Inversebuilt in
A†A^\dagger
A^\daggerConjugate transposebuilt in
det⁡(A)\det(A)
\det(A)Determinantbuilt in
tr⁡(A)\operatorname{tr}(A)
\operatorname{tr}(A)Traceamsmath
∥x∥2\|x\|_2
\|x\|_2Euclidean normbuilt in
⟨u,v⟩\langle u, v \rangle
\langle u, v \rangleInner productbuilt in

Separate columns with & and rows with \\. For large matrices with dots use \cdots, \vdots and \ddots; Kronecker and tensor products are on the operators page and index notation on the tensor notation page.

Frequently asked questions about linear algebra in LaTeX

How do I write a matrix in LaTeX?
Load amsmath and use a matrix environment in math mode, separating columns with & and rows with \\: \begin{pmatrix} a & b \\ c & d \end{pmatrix}. pmatrix gives parentheses, bmatrix square brackets, Bmatrix braces, vmatrix single bars for a determinant and Vmatrix double bars.
How do I write the transpose in LaTeX?
Write A^\top, which prints a small T, or simply A^T, or A^\intercal from amssymb. Pick one and use it consistently; A^\top is common in modern texts because it cannot be confused with a variable T.
How do I write a vector in LaTeX?
Use \mathbf{v} for a bold vector or \vec{v} for an arrow accent; \boldsymbol{v} from amsmath also works for Greek letters. A column vector is a one-column matrix: \begin{pmatrix} x \\ y \end{pmatrix}.
x⃗\vec{x}

Vector

\vec{x}
x\mathbf{x}

Bold Vector

\mathbf{x}
x^\hat{x}

Hat Vector

\hat{x}
A⊤A^{\top}

Transpose

A^{\top}
ATA^T
A−1A^{-1}

Inverse

A^{-1}
det⁡(A)\det(A)
∣A∣|A|
tr(A)\text{tr}(A)

Trace

\text{tr}(A)
rank(A)\text{rank}(A)

Rank

\text{rank}(A)
∥x∥\lVert x \rVert

Norm

\lVert x \rVert
∥x∥\| x \|
⟨x,y⟩\langle x, y \rangle

Inner Product

\langle x, y \rangle
⊗\otimes
⊕\oplus
⋅\cdot
×\times
δij\delta_{ij}

Kronecker Delta

\delta_{ij}
InI_n
0\mathbf{0}

Zero Matrix

\mathbf{0}
λ\lambda

Eigenvalue

\lambda
[abcd]\begin{bmatrix} a & b \\ c & d \end{bmatrix}

Matrix

\begin{bmatrix} a & b \\ c & d \end{bmatrix}
(xy)\begin{pmatrix} x \\ y \end{pmatrix}

Column Vector

\begin{pmatrix} x \\ y \end{pmatrix}