# \hskip

Low-level manual horizontal spacing in math expressions or macro definitions.

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

## Metadata

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

## Syntax

### base

Argument specification: `m:L`

Low-level manual horizontal spacing in math expressions or macro definitions.

### textmacros

Argument specification: `m:L`

Used to insert explicit horizontal space in text, especially in low-level TeX-style spacing adjustments.

## Examples

```latex
\hskip 10pt
```

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

```latex
\hskip{10pt}
```

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

```latex
a \hskip 2em b
```

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

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

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

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

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

## Package variants

| Package | Argument specification | Allowed mode | Description |
| --- | --- | --- | --- |
| base | m:L | math | Low-level manual horizontal spacing in math expressions or macro definitions. |
| textmacros | m:L | text | Used to insert explicit horizontal space in text, especially in low-level TeX-style spacing adjustments. |

## 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.

### Discouraged in base

Plain TeX primitive, often replaced by LaTeX's \hspace in standard documents

```latex
\hspace{$1}
```

Standard LaTeX macro for horizontal spacing

### Discouraged in textmacros

TeX primitive. In standard LaTeX documents, \hspace is preferred.

```latex
\hspace{$1}
```

LaTeX provides \hspace as the standard user-level command for horizontal spacing instead of the plain TeX primitive \hskip.

### [base/hskip-to-hspace](https://texform.dev/rules/base/hskip-to-hspace)

Collapse hskip to the explicit hspace command.

Level: authoring. Fidelity: reading.

```latex
\hskip #1
```

→

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

```latex
A \hskip 1em B
```

→

```latex
A \hspace{1em} B
```

## Equivalent forms

```latex
\hspace #1
```

exact. Both names are mapped directly to the same MathJax parse method with no extra parameters.

## See also

- [\\hspace](https://texform.dev/latex/commands/hspace)
- [\\kern](https://texform.dev/latex/commands/kern)
- [\\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 |
| --- | --- | --- | --- | --- |
| \hskip{1pt} | Positive: baseline | Pass | Pass | Fail |
| \hskip 1pt | Positive: bare[0] | Pass | Pass | Pass |
| \hskip{a} | Negative: neg:L[0] | Fail | Fail | Fail |

### textmacros

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