# \smqty

Used as the short command for small or inline physics-package matrix quantities, with optional parentheses, brackets, braces-as-input, or vertical bars around the body.

https://texform.dev/latex/commands/smqty

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Physics: matrices](https://texform.dev/latex/topics/physics-matrices) |
| Packages | physics |
| Allowed mode | math |
| Tags | mathjax-extension |
| Commonality | low |
| Kind | prefix |

## Syntax

### physics

Argument specification: `s d<(,)><[,]><{,}><|,|>`

Used as the short command for small or inline physics-package matrix quantities, with optional parentheses, brackets, braces-as-input, or vertical bars around the body.

## Examples

```latex
\smqty{a & b \\ c & d}
```

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

```latex
\smqty(a & b \\ c & d)
```

[Open in Playground](https://play.texform.dev/?input=%5Csmqty%28a+%26+b+%5C%5C+c+%26+d%29)

```latex
\smqty[a]
```

[Open in Playground](https://play.texform.dev/?input=%5Csmqty%5Ba%5D)

```latex
\smqty|a|
```

[Open in Playground](https://play.texform.dev/?input=%5Csmqty%7Ca%7C)

```latex
\smqty*(a)
```

[Open in Playground](https://play.texform.dev/?input=%5Csmqty*%28a%29)

## Renderer support

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

## In TeXForm

TeXForm parses this entry as prefix syntax; the package determines its argument specification.

### Expands to (physics)

```latex
\smqty(#1)
```

→

```latex
\left(\begin{smallmatrix}{} #1\end{smallmatrix}\right)
```

Source constructs and reparses this macro string with array='smallmatrix'. Other valid branches generate unfenced smallmatrix for {#1}, bracket or vertical-bar fenced smallmatrix forms for [#1] and |#1|, empty parentheses when no body follows, and \lgroup/\rgroup for \smqty*(#1).

## Equivalent forms

```latex
\smallmatrixquantity(#1)
```

exact. \smallmatrixquantity is mapped to the same MatrixQuantity implementation with the small=true parameter.

## See also

- [\\matrixquantity](https://texform.dev/latex/commands/matrixquantity)
- [\\mqty](https://texform.dev/latex/commands/mqty)
- [\\smallmatrixquantity](https://texform.dev/latex/commands/smallmatrixquantity)

## Test cases

### physics

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \smqty | Positive: baseline | Pass | Fail | Pass |
| \smqty* | Positive: vary:s[0] | Pass | Fail | Pass |
| \smqty (a) | Positive: vary:d[1] | Pass | Fail | Pass |
| \smqty*(a) | Positive: maximal | Pass | Fail | Pass |
