0

I know how to draw the following multiline matrix using brackets on both sides:

$$\begin{bmatrix}1&5&-3\\-2&-13&8\\3&-3&1\end{bmatrix}$$

The question is, how do I do it with curly braces? I know how to do curly braces on the left side (using cases), but how do I get the curly braces on both sides? I'm writing this in the Jupyter notebook version 5.7.8.

2
  • 1
    Don't use $$.
    – fractal
    Commented Jan 5, 2020 at 17:19
  • So how do I do in-line math-mode (equivalent to $)?
    – Yehuda
    Commented Jan 5, 2020 at 17:29

3 Answers 3

5

With Bmatrix from amsmath:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
   \begin{Bmatrix} 
      1 &   5 & -3 \\
     -2 & -13 &  8 \\
      3 &  -3 &  1
   \end{Bmatrix}
\]

\end{document}
4

Anothers possibility on the off-chance that something was going wrong during compilation is to use nicematrix or spalign package where you can easily align minus sign easily: option l left, c center and r right.

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage{nicematrix}
\usepackage{verbatim}
\usepackage{spalign}
\begin{document}
\[\begin{BNiceMatrix}
  1 & 5 & -3 \\
 -2 & -13 &  8 \\
  3 & -3 &  1
\end{BNiceMatrix} \quad \verb|with nicematrix package|\]
\[\spaligndelims \{\} \spalignmat[r]{1 5 -3; -2 -13 8; 3 -3  1} \quad \verb|with spalign package|\]
\end{document}
2
  • 1
    an upvote for sharing about the package spalign,
    – MadyYuvi
    Commented Jan 6, 2020 at 8:57
  • 1
    @MadyYuvi Ahahaha :-) for me it is important to help the others....and that exists the sincerity and the semplicity from the people..like you.
    – Sebastiano
    Commented Jan 6, 2020 at 11:49
2

As other have said, the Bmatrix environment from amsmath is probably the best solution here, but I think it's worth to keep in mind that a similar result can be achieved by adding \left\{...\right\} around a matrix environment.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{Bmatrix}1&5&-3\\-2&-13&8\\3&-3&1\end{Bmatrix}
\qquad
\left\{ \begin{matrix}1&5&-3\\-2&-13&8\\3&-3&1\end{matrix} \right\}
\]
\end{document}

This solution can easily be adapted for any kind of braces, or with different braces on both sides, or even to give the matrix a brace on only one side.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .