Template:Tmath/doc

This template wraps a math expression written in TeX code between  tags using the   parser function magic word. Intended to be used for very short expressions.

It further helps to avoid wrapping points at either end of expression that normally occurs with, so avoiding being split from punctuation as would be normal for text.

Neither  nor TeX math mode   is set by this template.

Examples

 * gives $a$
 * gives $\pi$
 * gives $x_0$

The template is intended to be used for short LaTeX mathematical expressions like variables, and is useful for limiting awkward wrapping points. It is more cumbersome to use for equations or other expressions containing special signs that must be escaped or replaced, like the equal sign  with   and the vertical pipe   with ,   or  , and   with  :
 * gives $$
 * gives $$
 * gives $x = \Vert \vec x \Vert$

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.
 * parses (you added that space!) to $\zeta(2) = \frac{\pi^2}{6}$
 * fails to parse (you forgot that space!), v.g. $\zeta(2) = \frac{\pi^2}{6}$
 * parses (you added all those spaces!) to $\frac{1}{ x^{2n+1} }$
 * fails to parse (you forgot some of those spaces!), v.g. $\frac{1}{x^{2n+1}} |undefined$

Uniform compatible formatting guideline
When converting between  and , first adjusting the expression to be compatible with both can help. A guideline for such formatting is:
 * Do not use templates internally, such as,  ,  , etc.
 * Replace all pipe characters:  by   or , and   by.
 * Introduce a space between adjacent identical braces: replace all occurrences of  by   and   by
 * Ensure a space at the end – this removes the possibility that a trailing  will adjoin the closing braces of the
 * Replace a  parameter with a leading.
 * With these adjustments, it should be possible to interchange the tags  and a template  .  Note the use of the parameter number   to avoid a problem with an equals sign in the expression.  Any text, such as punctuation, that does not naturally form part of the expression should be moved out of the.