Renderer support
| Package | MathJax | KaTeX | XeTeX |
|---|---|---|---|
base | MathJax: Full | KaTeX: Full | XeTeX: Full |
textmacros | MathJax: Full | KaTeX: Full | XeTeX: Full |
Syntax#
\textrmm:T{a}text contentArgspec m:T — one mandatory argument. Same argspec in base and textmacros. Reading argspecs
Common tasks#
How to write roman text inside math#
Examples#
Package variants#
| Package | Signature | Allowed mode | Notes |
|---|---|---|---|
base | m:T | math | Roman/upright text inside math expressions, especially in older LaTeX source. |
textmacros | m:T | text | Used to set a short span in roman text inside MathJax text mode. |
In TeXForm#
TeXForm parses this entry as prefix syntax; the package determines its argument specification.
Expands to (textmacros)#
\textrm{#1} {\rm #1}Equivalent forms#
\textup{#1}exactMathJax maps both to BaseMethods.HBox with VARIANT.NORMAL; LaTeX NFSS distinguishes family and shape conceptually, but not here.
See also#
\bmodbase\bmqtyphysics\boxedams\brabraket\Brabraket\flatfracphysics\hboxbase\iffbase\imathbbbboldx\imathbfbbbboldx\impliedbyams\impliesams\itextbbbboldx\itextbfbbbboldx\jmathbbbboldx\jmathbfbbbboldx\jtextbbbboldx\jtextbfbbbboldx\ketbraket\Ketbraket\ketbrabraket\Ketbrabraket\LaTeXbase\mathstrutbase\matrixdeterminantphysics\mboxbase\mdetphysics\modbase\pmbbase\pmodbase\pmqtyphysics\Pmqtyphysics\podbase\qcphysics\qcommaphysics\Residuephysics\sbmqtyphysics\skewbase\smdetphysics\spmqtyphysics\sPmqtyphysics\stackbinbase\stackrelbase\substackams\svmqtyphysics\TeXbase\textbase\textbfbase\textitbase\textnormalbase\textsfbase\textttbase\textupbase\varinjlimams\varliminfams\varlimsupams\varprojlimams\vmqtyphysics\zeromatrixphysics\zmatphysics
Test cases#
| Input | Case | MathJax | KaTeX | XeTeX |
|---|---|---|---|---|
\textrm{a} | Positive · baseline | Pass | Pass | Pass |
\textrm a | Positive · bare[0] | Pass | Pass | Pass |
\textrm{a^2} | Negative · neg:T[0] | Pass | Fail | Fail |
| Input | Case | MathJax | KaTeX | XeTeX |
|---|---|---|---|---|
\textrm{a} | Positive · baseline | Pass | Pass | Pass |
\textrm a | Positive · bare[0] | Pass | Pass | Pass |
\textrm{a^2} | Negative · neg:T[0] | Fail | Fail | Fail |