# gathered

Used for grouped multi-line formulas centered as a single inner block inside another displayed equation, with an optional vertical-position argument.

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

## Metadata

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

## Syntax

### ams

Argument specification: `o`

Used for grouped multi-line formulas centered as a single inner block inside another displayed equation, with an optional vertical-position argument.

## Examples

```latex
\begin{gathered}a\end{gathered}
```

[Open in Playground](https://play.texform.dev/?input=%5Cbegin%7Bgathered%7Da%5Cend%7Bgathered%7D)

```latex
\begin{gathered}[b]a\end{gathered}
```

[Open in Playground](https://play.texform.dev/?input=%5Cbegin%7Bgathered%7D%5Bb%5Da%5Cend%7Bgathered%7D)

## Renderer support

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

## Usage frequency

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

## In TeXForm

TeXForm reads the environment body in math mode.

## See also

- [aligned](https://texform.dev/latex/environments/aligned)

## Test cases

### ams

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \begin{gathered} a \\ b \end{gathered} | Positive: ctx:basic | Pass | Pass | Pass |
| \begin{gathered}[b] a \\ b \end{gathered} | Positive: ctx:with-pos | Pass | Pass | Pass |
