# How to create the following diagonal matrix in Latex?

You can get it by using the pmatrix environment and \dots commands of the mathtools package.

\documentclass{article}

\usepackage{mathtools}

\begin{document}

$\begin{pmatrix} a & 0 & \dots & 0 \\ 0 & 1 & \dots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & 1 \end{pmatrix}$

\end{document}


Here is the output:

• accurate code, but all the dots commands are actually in the basic latex set. pmatrix is in amsmath. nonetheless, loading mathtools is probably the best way to go -- it loads amsmath, so it's a "one stop shop". – barbara beeton Apr 7 '18 at 13:18

Using mtpro2 version [lite] you can have a best aestetical bracket parens.

\documentclass[12pt]{article}
\usepackage{times} % Use the Times font for headings
\usepackage[lite]{mtpro2}
\usepackage{mathtools}

\begin{document}
$\PARENS{\begin{matrix} a & 0 & \dots & 0 \\ 0 & 1 & \dots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & 1 \end{matrix}}$

\end{document}