# Creating a matrix using brackets [duplicate]

This question already has an answer here:

How to write this in latex:

The closest I've come to it, is this:

\{\begin{matrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{matrix}\}


## marked as duplicate by egreg, Community♦Dec 5 '16 at 10:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• Welcome! The manual of amsmath tells you to use \begin{Bmatrix}...\end{Bmatrix} – egreg Dec 5 '16 at 10:07

## 1 Answer

Use the amsmath Bmatrix

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$\begin{Bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{Bmatrix}$

\end{document}


Other types are:

1. \begin{matrix}...\end{matrix} without brackets
2. \begin{pmatrix}...\end{pmatrix} with parentheses brackets
3. \begin{bmatrix}...\end{bmatrix} with brackets
4. \begin{vmatrix}...\end{vmatrix} with vertical bar brackets
5. \begin{Vmatrix}...\end{Vmatrix} with double vertical bar brackets
6. \begin{Bmatrix}...\end{Bmatrix} with curly brackets as shown at top