# How to get a bold matrix

How can I typeset a matrix in bold? I usually use bmatrix, so I tried

\documentclass{article}
\usepackage{amsmath, bm}

\begin{document}

$\bm{\begin{bmatrix} 1 & 2 \end{bmatrix} }$

\end{document}


but it just hangs when I compile.

• before the display, and preferably within a group so that it doesn't persist, issue the command \boldmath. i'm not sure whether it will make the brackets bold, but the contents should be. – barbara beeton Oct 7 '16 at 1:00

you can make an entire display bold using \boldmath. this must be entered outside of the display, so it's necessary to bury it in a group so that it won't persist. i recommend \begingroup ... \endgroup, but { ... } is equally effective, if not always as easy to spot.

if only part of a display should be bold, and \bm doesn't work, the part that should be bold can be isolated within \text{\boldmath $...$}, adding \displaystyle if necessary.

this example is a bit more complicated than necessary, but i wanted to show the two methods, and also illustrate that the brackets are not made bold in the process.

\documentclass{article}
\usepackage{amsmath, bm}
\textwidth=.5\textwidth

\begin{document}
\noindent some text above the display.
\begingroup \boldmath
$\begin{bmatrix} 1 & 2\\ 3 & 4 \end{bmatrix}$
\endgroup
text below the display; spacing check.
$\begin{bmatrix} 1 & 2\\ 3 & 4 \end{bmatrix} + \text{\boldmath \begin{bmatrix} 1 & 2\\ 3 & 4 \end{bmatrix}}$
and still more text.

\end{document}