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}\}
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:
\begin{matrix}...\end{matrix} without brackets\begin{pmatrix}...\end{pmatrix} with parentheses brackets\begin{bmatrix}...\end{bmatrix} with brackets\begin{vmatrix}...\end{vmatrix} with vertical bar brackets\begin{Vmatrix}...\end{Vmatrix} with double vertical bar brackets\begin{Bmatrix}...\end{Bmatrix} with curly brackets as shown at topAnother workaround is to use \left...\right option.
\left\{
\begin{matrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{matrix}
\right\}
This could prove helpful when typing things like open-triangle close-vertical (<a|) braces etc.
amsmathtells you to use\begin{Bmatrix}...\end{Bmatrix}– egreg Dec 05 '16 at 10:07