# \eqalign

Typesetting aligned equations using Plain TeX syntax

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

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Matrices](https://texform.dev/latex/topics/matrices) |
| Packages | base |
| Allowed mode | math |
| Tags | mathjax-extension, discouraged |
| Commonality | medium |
| Kind | prefix |

## Syntax

### base

Argument specification: `m`

Typesetting aligned equations using Plain TeX syntax

## Examples

```latex
\eqalign{a & b \cr c & d}
```

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

```latex
\eqalign a
```

[Open in Playground](https://play.texform.dev/?input=%5Ceqalign+a)

## Renderer support

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

## In TeXForm

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

### Discouraged in base

Plain TeX command that has been superseded by LaTeX environments.

```latex
\begin{aligned} $1 \end{aligned}
```

Standard LaTeX (amsmath) convention.

### [base/eqalign-to-aligned-env](https://texform.dev/rules/base/eqalign-to-aligned-env)

Rewrite eqalign to the standard aligned environment.

Level: authoring. Fidelity: reading.

```latex
\eqalign{#1 \cr #2}
```

→

```latex
\begin{aligned} #1 \\ #2 \end{aligned}
```

```latex
\eqalign{f(x)&=x^3-1 \cr f'(x)&=3x^2 \cr f''(x)&=6x}
```

→

```latex
\begin{aligned} f(x)&=x^3-1 \\ f'(x)&=3x^2 \\ f''(x)&=6x \end{aligned}
```

## See also

- [\\array](https://texform.dev/latex/commands/array)
- [\\cases](https://texform.dev/latex/commands/cases)
- [\\displaylines](https://texform.dev/latex/commands/displaylines)
- [\\eqalignno](https://texform.dev/latex/commands/eqalignno)
- [\\leqalignno](https://texform.dev/latex/commands/leqalignno)
- [\\matrix](https://texform.dev/latex/commands/matrix)
- [\\pmatrix](https://texform.dev/latex/commands/pmatrix)

## Test cases

### base

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \eqalign{a} | Positive: baseline | Pass | Fail | Fail |
| \eqalign a | Positive: bare[0] | Pass | Fail | Fail |
