Spacing\hspace

\hspaceCommand

Manual horizontal spacing around symbols or subexpressions in math formulas.

\hspace{1em}
Topic
Spacing
Available in
base, textmacros
Kind
prefix
Allowed mode
math, text
Frequency
<0.01% of corpus formulasrank 171 of 263
Commonality
medium
Tags
spacing
Renderer support
PackageMathJaxKaTeXXeTeX
baseMathJax: PartialKaTeX: PartialXeTeX: Partial
textmacrosMathJax: PartialKaTeX: PartialXeTeX: Partial
About the test scope

Syntax#

\hspaces*starm:L{1em}dimension

Argspec s m:L — one optional and one mandatory argument. Same argspec in base and textmacros. Reading argspecs

Examples#

base

\hspace*{1em}

textmacros

\text{a\hspace{1em}b}

textmacros

\text{a\hspace*{1em}b}

Package variants#

PackageSignatureAllowed modeNotes
bases m:LmathManual horizontal spacing around symbols or subexpressions in math formulas.
textmacross m:LtextUsed to insert explicit horizontal space in text documents and layouts.

In TeXForm#

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

Equivalent forms#

  • \hskip #1exact

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

  • \hskip #1approximate

    Plain TeX primitive.

See also#

Test cases#

base
InputCaseMathJaxKaTeXXeTeX
\hspace{1pt}Positive · baselinePassPassPass
\hspace*{1pt}Positive · vary:s[0]FailPassPass
\hspace 1ptPositive · bare[1]PassFailFail
\hspace{a}Negative · neg:L[1]FailFailFail
textmacros
InputCaseMathJaxKaTeXXeTeX
\hspace{1pt}Positive · baselinePassPassPass
\hspace*{1pt}Positive · vary:s[0]FailPassPass
\hspace 1ptPositive · bare[1]PassFailFail
\hspace{a}Negative · neg:L[1]FailFailFail
All 32 in Spacing