# smallmatrix

Used for compact inline matrices, often inside delimiters or larger formulas

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

## Metadata

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

## Syntax

### ams

Argument specification: ``

Used for compact inline matrices, often inside delimiters or larger formulas

### physics

Argument specification: ``

Used for compact inline matrices or small matrix subexpressions when full-sized matrix environments would be too large.

## Examples

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

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

```latex
\begin{smallmatrix} 1 & 0 \\ 0 & 1 \end{smallmatrix}
```

[Open in Playground](https://play.texform.dev/?input=%5Cbegin%7Bsmallmatrix%7D+1+%26+0+%5C%5C+0+%26+1+%5Cend%7Bsmallmatrix%7D)

## Package variants

| Package | Argument specification | Allowed mode | Description |
| --- | --- | --- | --- |
| ams |  | math | Used for compact inline matrices, often inside delimiters or larger formulas |
| physics |  | math | Used for compact inline matrices or small matrix subexpressions when full-sized matrix environments would be too large. |

## Renderer support

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

## Usage frequency

0.05% of formulas in the measured corpus contain this entry, rank 21 of 31 entries with frequency data.

## In TeXForm

TeXForm reads the environment body in math mode.

## See also

- [bmatrix](https://texform.dev/latex/environments/bmatrix)
- [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)
- [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{smallmatrix} a & b \\\\ c & d \end{smallmatrix} | Positive: baseline | Pass | Pass | Pass |

### physics

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