Boxes and text\hbox

\hboxCommand

Low-level boxing of short text fragments inside math expressions.

\hbox{a}
Available in
base
Kind
prefix
Allowed mode
both
Frequency
0.41% of corpus formulasrank 70 of 263
Commonality
low
Tags
decoration, discouraged
Renderer support
PackageMathJaxKaTeXXeTeX
baseMathJax: FullKaTeX: FullXeTeX: Partial
About the test scope

Syntax#

\hboxm:T{a}text content

Argspec m:T — one mandatory argument. Reading argspecs

Common tasks#

How to insert a horizontal text box in math#

Legacy TeX box; prefer \text in LaTeX documents.

x = 0 \hbox{ otherwise}

How to freeze the size of a label#

a_{\hbox{min}}

Examples#

\hbox b
\raisebox{1ex}{\hbox{$x^2$}}

In TeXForm#

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

Equivalent forms#

  • \mbox{#1}exact

    In MathJax base, both map to BaseMethods.HBox with style 0.

See also#

Test cases#

base
InputCaseMathJaxKaTeXXeTeX
\hbox{a}Positive · baselinePassPassPass
\hbox aPositive · bare[0]PassPassFail
\hbox{a^2}Negative · neg:T[0]PassFailFail
All 21 in Boxes and text