# \mkern

Fine math kerning between symbols where the inserted space should not become a line-break opportunity.

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

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Spacing](https://texform.dev/latex/topics/spacing) |
| Packages | base, textmacros |
| Allowed mode | math, text |
| Tags | spacing |
| Commonality | low |
| Kind | prefix |

## Syntax

### base

Argument specification: `m:L`

Fine math kerning between symbols where the inserted space should not become a line-break opportunity.

### textmacros

Argument specification: `m:L`

Used for explicit kerning-style horizontal spacing adjustments.

## Examples

```latex
\mkern -2mu
```

[Open in Playground](https://play.texform.dev/?input=%5Cmkern+-2mu)

```latex
\mkern{-2mu}
```

[Open in Playground](https://play.texform.dev/?input=%5Cmkern%7B-2mu%7D)

```latex
\text{\mkern 1em}
```

[Open in Playground](https://play.texform.dev/?input=%5Ctext%7B%5Cmkern+1em%7D)

```latex
\text{\mkern{1em}}
```

[Open in Playground](https://play.texform.dev/?input=%5Ctext%7B%5Cmkern%7B1em%7D%7D)

## Package variants

| Package | Argument specification | Allowed mode | Description |
| --- | --- | --- | --- |
| base | m:L | math | Fine math kerning between symbols where the inserted space should not become a line-break opportunity. |
| textmacros | m:L | text | Used for explicit kerning-style horizontal spacing adjustments. |

## Renderer support

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

## In TeXForm

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

### [base/mkern-to-mspace](https://texform.dev/rules/base/mkern-to-mspace)

Collapse mkern to the explicit mspace command.

Level: faithful. Fidelity: reading.

```latex
\mkern #1
```

→

```latex
\mspace{#1}
```

```latex
\text{A\mkern 1em B}
```

→

```latex
\text{A\mspace{1em}B}
```

## Equivalent forms

```latex
\mspace{10mu}
```

approximate. \mspace is the macro equivalent

```latex
\kern 10pt
```

approximate. \kern uses absolute units rather than mu

```latex
\mspace{#1}
```

exact. 

## See also

- [\\hskip](https://texform.dev/latex/commands/hskip)
- [\\hspace](https://texform.dev/latex/commands/hspace)
- [\\kern](https://texform.dev/latex/commands/kern)
- [\\mskip](https://texform.dev/latex/commands/mskip)
- [\\mspace](https://texform.dev/latex/commands/mspace)

## Test cases

### base

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \mkern{1pt} | Positive: baseline | Pass | Pass | Fail |
| \mkern 1pt | Positive: bare[0] | Pass | Pass | Fail |
| \mkern{a} | Negative: neg:L[0] | Fail | Fail | Fail |

### textmacros

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \mkern{1pt} | Positive: baseline | Pass | Pass | Fail |
| \mkern 1pt | Positive: bare[0] | Pass | Pass | Fail |
| \mkern{a} | Negative: neg:L[0] | Fail | Fail | Fail |
