Boxes and text\textup

\textupCommand

Explicitly setting inserted text upright inside math expressions.

\textup{a}
Available in
base, textmacros
Kind
prefix
Allowed mode
math, text
Frequency
0.32% of corpus formulasrank 74 of 263
Commonality
medium
Tags
presentation
Renderer support
PackageMathJaxKaTeXXeTeX
baseMathJax: FullKaTeX: FullXeTeX: Full
textmacrosMathJax: FullKaTeX: FullXeTeX: Full
About the test scope

Syntax#

\textupm:T{a}text content

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

Examples#

base

\textup b

textmacros

\text{\textup{a}}

Package variants#

PackageSignatureAllowed modeNotes
basem:TmathExplicitly setting inserted text upright inside math expressions.
textmacrosm:TtextUsed to force upright text for a short span inside MathJax text mode.

In TeXForm#

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

Expands to (textmacros)#

\textup{#1} {\rm #1}

MathJax textmacros implements this identically to \textrm and \textnormal, rather than distinguishing upright-shape semantics as full LaTeX does.

Equivalent forms#

  • \textrm{#1}exact

    MathJax maps both to BaseMethods.HBox with VARIANT.NORMAL; LaTeX NFSS distinguishes family and shape conceptually, but not here.

  • \textrm{#1}exact

    In MathJax textmacros, both commands map to {\rm #1}.

  • \textnormal{#1}exact

    In MathJax textmacros, both commands map to {\rm #1}.

See also#

Test cases#

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