Wraps a math expression written in TeX code in `<math>...</math>` tags using the `{{#tag:}}`

parser function extension. Intended to be used for very short expressions like variables.

Neither `display="inline"` nor TeX math mode textstyle is set by this template.

## Usage[edit]

`{{tmath|expression}}`

### Examples[edit]

`{{tmath|a}}`

gives

`{{tmath|\pi}}`

gives

`{{tmath|x_0}}`

gives

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

`{{tmath|x {{=}} {{!}} \vec x {{!}} }}`

gives

### Use braces { and } with caution[edit]

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 {{!}} }}`

gives

`{{tmath|\zeta(2) {{=}} \frac{\pi^2} }}`

parses (you added that space!) to

`{{tmath|\zeta(2) {{=}} \frac{\pi^2}}}`

fails to parse (you forgot that space!), v.g.**Failed to parse (syntax error): {\displaystyle \zeta(2) = \frac{\pi^2}**}

`{{tmath|\frac{ x^ } }}`

parses (you added all those spaces!) to

`{{tmath|\frac} }}`

fails to parse (you forgot some of those spaces!), v.g.**Failed to parse (syntax error): {\displaystyle \frac**}}

## See also[edit]

The above documentation is transcluded from Template:Tmath/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |