Wikipedia:Rendering math: Difference between revisions
Appearance
Content deleted Content added
→Comparison of presentations: make this table nicer too, also update to {{bra}}, {{ket}}, {{bra-ket}} |
→Comparison of presentations: Let's not over-complicate things with personal styles and options. |
||
Line 55: | Line 55: | ||
|Does not distinguish a formula from the running text.<br />The [[kerning]] often looks ugly and even illegible (such as in ''F''<sup>−1</sup>), which is difficult to rectify.<br />In articles mixing raw wiki with <math> formulae, the appearance of the same variable in the two types of formula does not match (serif vs sans-serif). |
|Does not distinguish a formula from the running text.<br />The [[kerning]] often looks ugly and even illegible (such as in ''F''<sup>−1</sup>), which is difficult to rectify.<br />In articles mixing raw wiki with <math> formulae, the appearance of the same variable in the two types of formula does not match (serif vs sans-serif). |
||
|- style="border-top: 3px solid;" |
|- style="border-top: 3px solid;" |
||
|{{anchor|texhtml presentation}}{{tl|math}} and, generally, "texhtml"||Default |
|||
|Distinguishes a formula from the running text.<br />Close match to the appearance of inline <math>. |
|Distinguishes a formula from the running text.<br />Close match to the appearance of inline <math>. |
||
|Mixing of font families (sans-serif for English, serif for math), in running text, can be jarring. |
|Mixing of font families (sans-serif for English, serif for math), in running text, can be jarring. |
||
|- |
|||
|Tuned to [[Wikipedia talk:WikiProject Mathematics#div#bodyContent|Dmcq’s style]] |
|||
|Distinguishes a formula from the running text.<br />Requires less installed fonts that the variant below. |
|||
|As of January 2013, requires [[user:Dmcq/vector.css|a special tuning of the personal style]].<br />May differ in typeface from <math> formulae. |
|||
|- |
|||
|[[Wikipedia talk:WikiProject Mathematics/Archive/2012/Jul#texhtml|Tuned]] with MathJax fonts |
|||
|A tidy code looks very similar to <math> for simple formulae.<br />The best ratio of quality over computational resources spent to viewing of a formula.<br />Can share fonts with Nageh/mathJax.js |
|||
|As of January 2013, requires both locally installed fonts and [[user:Incnis Mrsi/common.css|a special tuning of the personal style]].<br />Often looks smaller than needed. |
|||
|- |
|- |
||
! colspan=4 | Specific {{visible anchor|templates}} |
! colspan=4 | Specific {{visible anchor|templates}} |
Revision as of 19:34, 24 May 2013
This is an essay. It contains the advice or opinions of one or more Wikipedia contributors. This page is not an encyclopedia article, nor is it one of Wikipedia's policies or guidelines, as it has not been thoroughly vetted by the community. Some essays represent widespread norms; others only represent minority viewpoints. |
This page in a nutshell: There exist at least 3 different forms of math formulae on wiki pages, with the number of options to present them being not less than 7. |
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. The title of the essay mimics both <>-brackets and template braces by using guillemet quotes.
Comparison of encodings
Encoding | Advantages | Disadvantages |
---|---|---|
<math> | Well-known and standardized. Portable to/from scientific papers. Clearly distinguishes semantics from appearance. Can handle all formulae. |
Requires knowledge of LaTeX markup language. Lacks some characters (such as Cyrillic script). Unable to place wikilinks on parts of formulae. |
Raw wiki or HTML code | Flexible and easy to learn. Same markup as the rest of wiki. |
Encodes the appearance of a formula rather than its semantics. Unable to handle square roots, vertical fractions, and other common formula types. Proper use (italic variables, protected spaces around operators) requires care and is a frequent source of mistakes. |
"texhtml" templates, such as {{math}} | Simplifies many of the problematic and failure-prone parts of raw wiki markup. Distinguishes semantics from appearance. |
Vulnerable to changes in templates and styles. The ubiquitous = symbol requires special care. Unable to handle complex formulae such as those involving summations, integrals, and limits. |
Comparison of presentations
Encoding | Presentation | Advantages | Disadvantages |
---|---|---|---|
<math> | [[LaTeX|Template:LaTeX]] renderer (Wikipedia’s default) |
Robust. Little overhead in a browser. |
A bitmap image format that does not match article text in size and cannot be copied and pasted. |
<math> | MathJax (general) | The best look. Text-friendly (except for hyperlinks). Uses very little server-side computation. |
Uses more client-side (in-browser) computation. Causes errors in vertical position after jumping to a #-link. Requires a modern browser. |
MathJax of MediaWiki | Supported officially. Easy for registered users to use. |
Not usable by unregistered readers. Slow to fix reported bugs. Fonts are invariably downloaded from server. | |
Nageh/mathJax.js | Better support than the official version. Can use locally installed fonts. |
The small user base makes it not worthwhile to make edits to articles that are aimed at this specific renderer. | |
Raw wiki or HTML code | Avoids switching font families in running text. Minimal overhead. Appearance does not depend on user (account) preferences. |
Does not distinguish a formula from the running text. The kerning often looks ugly and even illegible (such as in F−1), which is difficult to rectify. In articles mixing raw wiki with <math> formulae, the appearance of the same variable in the two types of formula does not match (serif vs sans-serif). | |
{{math}} and, generally, "texhtml" | Default | Distinguishes a formula from the running text. Close match to the appearance of inline <math>. |
Mixing of font families (sans-serif for English, serif for math), in running text, can be jarring. |
Specific templates | |||
{{mvar}}: q | Essentially, a shorthand to {{math|''q''}}. Clean semantics. |
As of January 2013, uses the <var> tag. Cannot be used for vectors. | |
{{sqrt}}: √2 | Clean semantics. Good look for cheap. |
The vinculum is slightly interrupted. Does not look well under {{math}} or so, itself. | |
{{radic}}: 3√2 | Same as above. | Same as above. | |
{{sfrac}}: 1/z | Clean semantics. Good look for cheap. |
Occupies too much vertical space in a running text, which is inherent to this notation. Embedded sub- and superscript causes vertical misalignment. | |
{{frac}}: 1⁄2 | Clean semantics. Good look for cheap. |
Discouraged by WP:MOSMATH. | |
{{open-open}}: (−∞, +∞) {{open-closed}}: (−∞, 0] |
Clearly distinguish intervals from other stuff in the code. | Get one parameter, not two, so semantics is a bit obscure. | |
Bra–ket notation: {{ket}} |ψ⟩ {{bra}} ⟨ψ| {{bra-ket}} ⟨ψ|ξ⟩ |
Clearly distinguish braket notation from other stuff in the code, clean semantics, no need to produce the markup or characters for angular brackets ⟨ &#amp;x27E8; or {{langle}}, ⟩ ⟩ or {{rangle}}, and vertical bar | | every time.
|
The templates are made using {{braket}}, which in turn uses {{langle}} and {{rangle}}, which in turn use angular brackets, which may not render on all browsers. | |
{{vec}}: A→ | Clean semantics. Good look (?) for cheap. |
The position of the arrow may not be exactly central for some letters (although this is more or less negligible). | |
{{intmath}}: ∫+∞ 0 |
Clean semantics. Good look (?) for cheap. |
The name "intmath" does not fit to established naming style. |
Discussions
- Wikipedia talk:MOSPHYS
- Wikipedia talk:WikiProject Mathematics/Archive/2013/Jan #Destruction of .7B.7Bmath.7D.7D and similar templates
See also
- WP: WikiProject Mathematics/Typography
- WP: texvc, a <math> to HTML converter; not used for HTML anymore
- Category:Mathematical formatting templates