# vmatrix

Used for determinant-style or absolute-value-style vertical-bar matrices

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

## 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 determinant-style or absolute-value-style vertical-bar matrices

## Examples

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

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

## Renderer support

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

## Usage frequency

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

## In TeXForm

TeXForm reads the environment body in math mode.

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

Rewrite the fenced vmatrix environment to explicit vertical bars around a core matrix environment.

Level: corpus. Fidelity: render.

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

→

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

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

→

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

## 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)
- [smallmatrix](https://texform.dev/latex/environments/smallmatrix)
- [subarray](https://texform.dev/latex/environments/subarray)
- [Vmatrix](https://texform.dev/latex/environments/Vmatrix)

## Test cases

### ams

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