Boxes and text\makebox

\makeboxCommand

Used to place content in a horizontal box with optional width and alignment, especially for layout/presentation control around short text or math fragments.

\makebox{x}
Available in
base
Kind
prefix
Allowed mode
both
Frequency
<0.01% of corpus formulasrank 193 of 263
Commonality
medium
Tags
presentation
Renderer support
PackageMathJaxKaTeXXeTeX
baseMathJax: FullKaTeX: NoneXeTeX: Partial
About the test scope

Syntax#

\makeboxo:L[1em]optional dimensionO{c}:N[\cs]optional control sequencem:T{a}text content

Argspec o:L O{c}:N m:T — two optional and one mandatory argument. Reading argspecs

Examples#

\makebox[2em]{x}
\makebox[2em][R]{x}
\raisebox{1ex}{\makebox[2em][l]{$x^2$}}

In TeXForm#

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

Test cases#

base
InputCaseMathJaxKaTeXXeTeX
\makebox{a}Positive · baselinePassFailPass
\makebox[1pt]{b}Positive · vary:o[0]PassFailPass
\makebox[a]{b}Positive · vary:o[1]PassFailFail
\makebox[1pt][b]{c}Positive · maximalPassFailPass
\makebox aPositive · bare[2]PassFailPass
\makebox[a]{a}Negative · neg:L[0]PassFailFail
\makebox[\alpha]{a}Negative · neg:N[1]PassFailFail
\makebox{a^2}Negative · neg:T[2]PassFailFail
All 21 in Boxes and text