Spacing\hphantom

\hphantomCommand

Used to reserve horizontal space in a mathematical formula corresponding to the argument, while taking up zero vertical space.

\hphantom{x}
Topic
Spacing
Available in
base, textmacros
Kind
prefix
Allowed mode
math, text
Frequency
0.02% of corpus formulasrank 153 of 263
Commonality
medium
Tags
invisible, spacing
Renderer support
PackageMathJaxKaTeXXeTeX
baseMathJax: FullKaTeX: FullXeTeX: Full
textmacrosMathJax: FullKaTeX: FullXeTeX: Full
About the test scope

Syntax#

\hphantomm{a}math content

Argspec m — one mandatory argument. In base. Reading argspecs

\hphantomm:T{a}text content

Argspec m:T — one mandatory argument. In textmacros. Reading argspecs

Examples#

base

\hphantom{abc}

textmacros

\text{\hphantom{abc}}

Package variants#

PackageSignatureAllowed modeNotes
basemmathUsed to reserve horizontal space in a mathematical formula corresponding to the argument, while taking up zero vertical space.
textmacrosm:TtextUsed to horizontally offset equations or table cells by a specific piece of text's width without altering vertical flow.

In TeXForm#

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

See also#

Test cases#

base
InputCaseMathJaxKaTeXXeTeX
\hphantom{a}Positive · baselinePassPassPass
\hphantom aPositive · bare[0]PassPassPass
textmacros
InputCaseMathJaxKaTeXXeTeX
\hphantom{a}Positive · baselinePassPassPass
\hphantom aPositive · bare[0]PassPassPass
\hphantom{a^2}Negative · neg:T[0]FailFailFail
All 32 in Spacing