Boxes and text\mbox

\mboxCommand

Boxing short text fragments inside math expressions without line breaking.

\mbox{a}
Available in
base
Kind
prefix
Allowed mode
both
Frequency
2.99% of corpus formulasrank 21 of 263
Commonality
medium
Tags
decoration
Renderer support
PackageMathJaxKaTeXXeTeX
baseMathJax: FullKaTeX: NoneXeTeX: Full
About the test scope

Syntax#

\mboxm:T{a}text content

Argspec m:T — one mandatory argument. Reading argspecs

Common tasks#

How to insert a short text label in math#

Legacy box; \text is the LaTeX replacement and scales in subscripts.

x=0 \mbox{ if } t<0

How to write a subscript word that should not shrink#

T_{\mbox{eff}}

Examples#

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

In TeXForm#

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

Equivalent forms#

  • \hbox{#1}exact

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

See also#

Test cases#

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