# \mathrel

Used to assign the relation math class to a symbol, treating it like an equals sign for spacing.

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

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Delimiters](https://texform.dev/latex/topics/delimiters) |
| Packages | base |
| Allowed mode | math |
| Tags |  |
| Commonality | medium |
| Kind | prefix |

## Syntax

### base

Argument specification: `m`

Used to assign the relation math class to a symbol, treating it like an equals sign for spacing.

## Examples

```latex
a \mathrel{=} b
```

[Open in Playground](https://play.texform.dev/?input=a+%5Cmathrel%7B%3D%7D+b)

## Renderer support

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

## Usage frequency

0.06% of formulas in the measured corpus contain this entry, rank 129 of 263 entries with frequency data.

## In TeXForm

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

### [base/duplicate-mathrel-wrapper-drop](https://texform.dev/rules/base/duplicate-mathrel-wrapper-drop)

Drop one directly nested duplicate mathrel wrapper.

Level: authoring. Fidelity: render.

```latex
\mathrel{\mathrel{#1}}
```

→

```latex
\mathrel{#1}
```

```latex
a\mathrel{\mathrel{=}}b
```

→

```latex
a\mathrel{=}b
```

## See also

- [\\mathbin](https://texform.dev/latex/commands/mathbin)
- [\\mathclose](https://texform.dev/latex/commands/mathclose)
- [\\mathinner](https://texform.dev/latex/commands/mathinner)
- [\\mathop](https://texform.dev/latex/commands/mathop)
- [\\mathopen](https://texform.dev/latex/commands/mathopen)
- [\\mathord](https://texform.dev/latex/commands/mathord)
- [\\mathpunct](https://texform.dev/latex/commands/mathpunct)

## Test cases

### base

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