# \kern

Fine manual spacing or kerning in math where the inserted space should inhibit a line break.

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

## 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 manual spacing or kerning in math where the inserted space should inhibit a line break.

### textmacros

Argument specification: `m:L`

Used for fine horizontal kerning adjustments in text.

## Examples

```latex
\kern 10pt
```

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

```latex
\kern{10pt}
```

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

```latex
a \kern 2em b
```

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

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

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

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

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

## Package variants

| Package | Argument specification | Allowed mode | Description |
| --- | --- | --- | --- |
| base | m:L | math | Fine manual spacing or kerning in math where the inserted space should inhibit a line break. |
| textmacros | m:L | text | Used for fine horizontal kerning adjustments in text. |

## Renderer support

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

## In TeXForm

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

## Equivalent forms

```latex
\mkern 10mu
```

approximate. \mkern is typically used for math units (mu)

```latex
\hspace{#1}
```

approximate. \hspace may allow line breaks whereas \kern is typically unbreakable unless followed by glue.

## See also

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

## Test cases

### base

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

### textmacros

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