A matrix can be described as a rectangular array of numbers, symbols or expressions that are arranged in rows and columns. A matrix in LaTeX can be generated with the help of a math environment for typesetting matrices. In this tutorial, we will discuss how to generate a matrix and make amendments with regard to the brackets.
For generating matrix in LaTeX we have to use the package amsmath by giving the command \usepackage{amsmath}.
Output of the code above
There can be various types of brackets to use in a matrix. Some of them are discussed below:
\begin{matrix}: This command creates a matrix without brackets or boundaries.
\begin{pmatrix}: This command creates a matrix with brackets or parenthesis.
\begin{bmatrix}: This command creates a matrix with square brackets or boundaries.
\begin{Bmatrix}: This command creates a matrix with curly brackets or boundaries.
\begin{vmatrix}: This command creates a matrix with a rectangular line boundary.
\begin{Vmatrix}: This command creates a matrix with double vertical bar brackets or boundaries.
A matrix can face alterations in spacing as we can give more distance between elements. The following code can demonstrate how:
Output of the code above