# Bmatrix

Used for matrices enclosed in curly braces, usually in specialized notational contexts

https://texform.dev/latex/environments/Bmatrix

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Matrices](https://texform.dev/latex/topics/matrices) |
| Packages | ams |
| Allowed mode | math |
| Tags | matrix, nestable |
| Commonality | medium |
| Body mode | math |

## Syntax

### ams

Argument specification: ``

Used for matrices enclosed in curly braces, usually in specialized notational contexts

## Examples

```latex
\begin{Bmatrix} a & b \\ c & d \end{Bmatrix}
```

[Open in Playground](https://play.texform.dev/?input=%5Cbegin%7BBmatrix%7D+a+%26+b+%5C%5C+c+%26+d+%5Cend%7BBmatrix%7D)

## Renderer support

| Package | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- |
| ams | full | full | full |

## Usage frequency

<0.01% of formulas in the measured corpus contain this entry, rank 27 of 31 entries with frequency data.

## In TeXForm

TeXForm reads the environment body in math mode.

### [ams/Bmatrix-env-to-brace-matrix](https://texform.dev/rules/ams/Bmatrix-env-to-brace-matrix)

Rewrite the fenced Bmatrix environment to explicit braces around a core matrix environment.

Level: corpus. Fidelity: render.

```latex
\begin{Bmatrix} #1 \end{Bmatrix}
```

→

```latex
\left\{\begin{matrix} #1 \end{matrix}\right\}
```

```latex
\begin{Bmatrix} a & b \\ c & d \end{Bmatrix}
```

→

```latex
\left\{\begin{matrix} a & b \\ c & d \end{matrix}\right\}
```

## See also

- [bmatrix](https://texform.dev/latex/environments/bmatrix)
- [cases](https://texform.dev/latex/environments/cases)
- [matrix](https://texform.dev/latex/environments/matrix)
- [pmatrix](https://texform.dev/latex/environments/pmatrix)
- [smallmatrix](https://texform.dev/latex/environments/smallmatrix)
- [subarray](https://texform.dev/latex/environments/subarray)
- [vmatrix](https://texform.dev/latex/environments/vmatrix)
- [Vmatrix](https://texform.dev/latex/environments/Vmatrix)

## Test cases

### ams

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \begin{Bmatrix} a & b \\\\ c & d \end{Bmatrix} | Positive: baseline | Pass | Pass | Pass |
