This template wraps a math expression written in TeX code between [math]...[/math]
tags using the {{#tag:}}
parser function magic word. It further avoids wrapping points at either end of expression that normally occurs with [math]...[/math]
, so avoiding being split from punctuation as would be normal for text. Intended to be used for very short expressions.
Neither display="inline"
nor TeX math mode \textstyle
is set by this template.
Usage
{{tmath|expression}}
Examples
{{tmath|a}}
gives 解析失败 (SVG(MathML可通过浏览器插件启用):从服务器“https://wikimedia.org/api/rest_v1/”返回无效的响应(“Math extension cannot connect to Restbase.”):): {\displaystyle a}{{tmath|\pi}}
gives 解析失败 (SVG(MathML可通过浏览器插件启用):从服务器“https://wikimedia.org/api/rest_v1/”返回无效的响应(“Math extension cannot connect to Restbase.”):): {\displaystyle \pi}{{tmath|x_0}}
gives 解析失败 (SVG(MathML可通过浏览器插件启用):从服务器“https://wikimedia.org/api/rest_v1/”返回无效的响应(“Math extension cannot connect to Restbase.”):): {\displaystyle x_0}
The template is intended to be used for very short LaTeX mathematical expressions like variables. It is more cumbersome to use for equations or other expressions containing special signs that have to be escaped, like the equal sign =
with
and the vertical pipe {{}}
|
with
:
{{!}}
{{tmath|E {{=}} mc^2}}
gives 解析失败 (SVG(MathML可通过浏览器插件启用):从服务器“https://wikimedia.org/api/rest_v1/”返回无效的响应(“Math extension cannot connect to Restbase.”):): {\displaystyle E = mc^2}{{tmath|x {{=}} {{!}} \vec x {{!}} }}
gives 解析失败 (SVG(MathML可通过浏览器插件启用):从服务器“https://wikimedia.org/api/rest_v1/”返回无效的响应(“Math extension cannot connect to Restbase.”):): {\displaystyle x = | \vec x | }
Use braces { and } with caution
Apart from using the
and {{(}}
templates to get {{)}}
{
and }
, you may use the braces {
and }
as long as {
is not preceded or followed by another {
, and }
is not preceded or followed by another }
, e.g.
{{tmath|x {{=}} {{!}} \vec{x} {{!}} }}
gives 解析失败 (SVG(MathML可通过浏览器插件启用):从服务器“https://wikimedia.org/api/rest_v1/”返回无效的响应(“Math extension cannot connect to Restbase.”):): {\displaystyle x = | \vec{x} | }{{tmath|\zeta(2) {{=}} \frac{\pi^2}{6} }}
parses (you added that space!) to 解析失败 (SVG(MathML可通过浏览器插件启用):从服务器“https://wikimedia.org/api/rest_v1/”返回无效的响应(“Math extension cannot connect to Restbase.”):): {\displaystyle \zeta(2) = \frac{\pi^2}{6} }{{tmath|\zeta(2) {{=}} \frac{\pi^2}{6}}}
fails to parse (you forgot that space!), v.g. 解析失败 (SVG(MathML可通过浏览器插件启用):从服务器“https://wikimedia.org/api/rest_v1/”返回无效的响应(“Math extension cannot connect to Restbase.”):): {\displaystyle \zeta(2) = \frac{\pi^2}{6} }{{tmath|\frac{1}{ x^{2n+1} } }}
parses (you added all those spaces!) to 解析失败 (SVG(MathML可通过浏览器插件启用):从服务器“https://wikimedia.org/api/rest_v1/”返回无效的响应(“Math extension cannot connect to Restbase.”):): {\displaystyle \frac{1}{ x^{2n+1} } }{{tmath|\frac{1}{x^{2n+1}} }}
fails to parse (you forgot some of those spaces!), v.g. 解析失败 (SVG(MathML可通过浏览器插件启用):从服务器“https://wikimedia.org/api/rest_v1/”返回无效的响应(“Math extension cannot connect to Restbase.”):): {\displaystyle \frac{1}{x^{2n+1} }}