This is anessay. It contains the advice or opinions of one or more Wikipedia contributors. This page is not an encyclopedia article, nor is it one ofWikipedia's policies or guidelines, as it has not beenthoroughly vetted by the community. Some essays represent widespread norms; others only represent minority viewpoints. |
| This page in a nutshell: There exist at least three different forms of math formulae on Wikipedia pages, with at least seven ways to present them. None is completely satisfactory. |
This essay offers a comparison of different encodings and presentation of mathematical formulae. The three principal ones are the<math> tag, raw wiki (or HTML) code, and "texhtml" templates. The<math> and "texhtml" encoding may have different presentations for registered users, depending on user preferences and personal styles.
| Encoding | Advantages | Disadvantages |
|---|---|---|
<math>LaTeX</math> |
| |
| Rawwiki orHTML code |
|
|
| "texhtml" templates, such as{{math}} |
|
|
| Encoding | Presentation | Advantages | Disadvantages |
|---|---|---|---|
<math> | SVG with hiddenMathML (Wikipedia's default) |
|
|
| PNG |
| ||
| NativeMathML |
|
| |
| MathJax |
|
| |
| KaTeX |
|
| |
| Raw wiki or HTML code |
|
| |
| {{math}} ('texhtml' class) |
|
| |
| Specifictemplates | |||
| {{mvar}}:x |
|
| |
| {{sqrt}}:√2 |
|
| |
| {{radic}}:3√2 |
|
| |
| {{sfrac}}:1/2 |
|
| |
| {{frac}}:1⁄2 |
|
| |
|
|
| |
| Bra–ket notation: |
|
| |
| {{vec}}:A→ |
|
| |
| {{intmath}}:∫+∞ 0 |
|
| |
|
| ||
\pagecolor and\definecolor) and the appearance respects CSS and browser settings while the typeface is conveniently altered to help you identify formulae.{{math|''i''}} for theimaginary unit and{{math|<var>i</var>}} for an arbitrary index variable.x" means mathematical variable "", whereas in HTML "x" is generic and somewhat ambiguous.{{math|<var>x</var>}}", adding the var tag doesn't affect the visual resultx and provides the additional semantic description that x is a variable. This requires diligence and more typing that could make the formula harder to understand as you type it, and provides no help to most readers, but could be worth considering if no other rendering options are available.In some cases it may be the best choice to use neither TeX nor the HTML substitutes, but instead Unicode or the simple ASCII symbols of a standard keyboard.
<math> to HTML converter; not used for HTML anymore