Matrices
Contents
amsmath matrix environments
The amsmath package provides commands to typeset matrices with different delimiters. Once you have loaded \usepackage
Type | L a T e X markup | Renders as |
---|---|---|
Plain | \begin 1 & 2 & 3\\ a & b & c \end \(\begin | |
Parentheses; round brackets | \begin a & b & c \end \(\begin | |
Brackets; square brackets | \begin 1 & 2 & 3\\ a & b & c \end \(\begin | |
Braces; curly brackets | \begin 1 & 2 & 3\\ a & b & c \end \(\begin | |
Pipes | \begin 1 & 2 & 3\\ a & b & c \end \(\begin | |
Double pipes | \begin 1 & 2 & 3\\ a & b & c \end \(\begin | |
If you need to create matrices with different delimiters, you can add them manually to a plain matrix . For example:
L a T e X markup | Renders as |
---|---|
\left\lceil \begin 1 & 2 & 3\\ a & b & c \end \right\rceil | \(\left\lceil\begin |
\left\langle \begin 1 & 2 & 3\\ a & b & c \end \right\rvert | \(\left\langle\begin |
\left\langle \begin 1 & 2 & 3\\ a & b & c \end \right\rangle | \(\left\langle\begin |
Inline matrices
When typesetting inline math, the usual matrix environments above may look too big. It may be better to use smallmatrix in such situations, although you will need to provide your own delimiters.
The following image shows the output produced by the example above:
The mathtools package provides psmallmatrix , bsmallmatrix etc environments for convenience.
LaTeX-Tutorial.com
The article discusses different methods to create matrices in LaTeX by using both array and amsmath package. A number of methods involving various types of matrices are represented with the help of illustrations.
Array Environment
For more control over your matrices, one useful tool provided by LaTeX is the array environment. It only needs the number of columns and their alignment as a parameter. Since we are creating a matrix, we probably need all elements centered. In that case, we can use the letter c as many as the number of columns to declare the centering alignment option. Then, we can type the elements of the matrix by separating each column inside a row with & , and separating rows with \\ . This environment only creates a grid for the contents of our matrix, so if we need brackets, we need to declare them separately. In the following example, we created a matrix with two rows and two columns inside brackets:
Below, there are two more examples, in which we explored the array environment with different sizes and contents.
Amsmath Package
The amsmath package provides commands to typeset matrices with different delimiters. Once you have loaded \usepackage
Matrix Type | Keyword | Output |
---|---|---|
Plain | matrix | Only the elements of the matrix |
Parentheses | pmatrix | Elements of the matrix in round brackets |
Brackets | bmatrix | Elements of the matrix in square brackets |
Braces | Bmatrix | Elements of the matrix in curly brackets |
Pipes | vmatrix | Elements of the matrix in vertical lines |
Double Pipes | Vmatrix | Elements of the matrix in double vertical lines |
Small Matrix | smallmatrix | A plain matrix in a smaller size |
Matrix Commands of the Amsmath Package
Let’s go over these commands. In the following examples, we demonstrated different kinds of delimiter options that comes with the amsmath package.
If we need another type of delimiter, we add them just like we did in the array environment, only this time we will use the plain matrix command. The following example shows two different matrices with different sets of brackets.
The amsmath package additionally provides a smaller size option, which is especially useful when typing a matrix within a paragraph. In the next example, we created a small matrix below a regular matrix.
Question 1: How to write m × n matrix in LaTeX using array?
A number of examples regarding matrices with different dimensions are mentioned in the Array Environment section. The array environment requires the user to specify the number of columns in its command: \begin
Question 2: What is the easiest way to type matrices in LaTeX?
The easiest way to type matrices is to use the amsmath package. This package allows writing matrices with different commands, illustrated in detail in the Amsmath Package section.
Question 3: When typing a matrix in LaTeX, which method provides better spacing?
The illustrations provided in sections Array Environment and Amsmath Package concludes that the matrices created using the amsmath package have better spacing than the matrices created by using the array environment.
How to write matrices in Latex ? matrix, pmatrix, bmatrix, vmatrix, Vmatrix
How to write matrices in Latex ? matrix, pmatrix, bmatrix, vmatrix, Vmatrix. Here are few examples to write quickly matrices.
First of all, modify your preamble adding*
*Thanks to Miss Paola Estrada for the fix.
LateX pmatrix, bmatrix, vmatrix, Vmatrix
pmatrix, bmatrix, vmatrix, Vmatrix are Latex environments:
- p for parentheses
- b for brackets
- v for verts
- B for braces
- V for double verts.
How to write an m x n matrix in LaTeX
How to write an m x n matrix with big parentheses
$$ \begin
Examples matrix 3 x 3 in LaTeX
$$ \begin
$$ \begin
LateX matrix with no bracket
LateX matrix determinant / vertical bar bracket
With vertical bar brackets:
Latex matrix with curly brackets
With curly brackets:
Latex matrix with double vertical bar brackets
With double vertical bar brackets:
Latex small inline matrix
Use smallmatrix environment
I love small matrice such $\big(\begin
Examples matrix 2 x 2 in LaTeX
Here are examples with matrix 2×2 with pmatrix, bmatrix, vmatrix, Vmatrix environments:
$$ \begin
Also in this section
Buy Me A Coffee !
This website was useful to you? Then it’s a good reason to buy me a coffee. It will give me the energy and motivation to continue this development. Thank you !
Latex
Blog template built with Bootstrap and Spip by Nadir Soualem @mathlinux.
http://latex-tutorial.com/matrices-in-latex/
http://math-linux.com/latex-26/faq/latex-faq/article/how-to-write-matrices-in-latex-matrix-pmatrix-bmatrix-vmatrix-vmatrix