This site is supported by donations to The OEIS Foundation.
Template:Text/doc
The {{text}} mathematical formatting template, meant to be used within the {{math}} template, gives normal Roman text in either HTML+CSS or LaTeX. It corresponds to the \text{ }
LaTeX command.
Initial and final blank spaces of template arguments
Note that the initial and final blank spaces of template arguments are parsed out by the MediaWiki server, so we unfortunately can't get the exact behavior of the \text{ }
LaTeX command, e.g.
-
''before''{{text| argument of the text template }}''after''
yields the text style HTML+CSS: before argument of the text template after
To get consistent behavior between HTML+CSS and LaTeX, you need to surround the {{text}} template with {{sp}} or {{sp|tex}} for HTML+CSS or LaTeX, respectively. E.g.
-
{{math|''before''{{sp}}{{text|argument of the text template}}{{sp}}''after''|&}}
yields the text style HTML+CSS:before argument of the text template after
-
{{math|''before''{{sp|tex}}{{text|argument of the text template|tex}}{{sp|tex}}''after''|$}}
yields the text style LaTeX:
Usage
- {{text|some text}}
or
- {{text|some text|format}}
where some text is
- the text to display in normal Roman (note that the initial and final blank spaces of template arguments are parsed out by the MediaWiki server, so we unfortunately can't get the exact behavior of the
\text{ }
LaTeX command)
and format is either
- htm: HTML+CSS (default);
- tex: LaTeX.
Examples
The code : before {{math|{{set|''n''{{sp}}{{sym|in}}{{sp}}{{sym|N}}{{sp}}:{{sp}}''n''{{sp}}{{text|is squarefree}}}}|&}} after
yields the text style HTML+CSS
- before
after{n ∈ ℕ : n is squarefree}
The code : before {{math|{{set|''n''{{sp|tex}}{{sym|in|tex}}{{sp|tex}}{{sym|N|tex}}:''n''{{sp|tex}}{{text|is squarefree|tex}}|tex}}|$}} after
yields the text style LaTeX
- before after
The code : {{math|{{sum|''p''{{sp}}{{text|prime}}||{{frac|1|''p''}}|HTM}}|&&}}
yields the display style HTML+CSS
∑ p prime1 p
The code : {{math|{{sum|''p''{{sp|tex}}{{text|prime|tex}}||{{frac|1|''p''|tex}}|TEX}}|$$}}
yields the display style LaTeX
See also