ਵਿਕੀਪੀਡੀਆ:«math»

ਵਿਕੀਪੀਡੀਆ, ਇੱਕ ਅਜ਼ਾਦ ਗਿਆਨਕੋਸ਼ ਤੋਂ

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.

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.
Temporarily unusable in section headings [1]
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.
More polished appearance than wiki/HTML code.
Vulnerable to changes in templates and styles.
The ubiquitous = symbol requires special care.
Unable to handle complex formulae such as those involving summations and limits.

Comparison of presentations[ਸੋਧੋ]

Encoding Presentation Advantages Disadvantages
<math> LaTeX renderer
(Wikipedia’s default)
Robust.
Little overhead in a browser.
A bitmap image format that does not match article text in size, is not as well anti-aliased as article text, cannot be copied and pasted, and does not change color when part of a link.
MathML with SVG fallback Robust.
Easy for registered users to use.
Little overhead in a browser.
Not usable by unregistered readers. Requires modern browsers. MathML not supported by some major modern browsers (e.g. Chrome) and not well-formatted by others. SVG has similar issues to the default renderer (mismatched font sizes and baselines, characters that are not as sharp as the surrounding text, inability to cut and paste)
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}} ('texhtml' class) 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.
Reverts to the appearance of raw wiki code on systems that don't support font changes (e.g. the Wikipedia Android app)
Specific templates
{{mvar}}: x A shorthand for variables like {{math|''x''}}.
Clean semantics.
Cannot be used for vectors.
{{sqrt}}: 2 Clean semantics. The vinculum is slightly interrupted.
Does not look well under {{math}} or so, itself.
{{radic}}: 32 Clean semantics. Same as above.
{{sfrac}}: 1/2 Clean semantics. Occupies too much vertical space in a running text. Embedded sub- and superscript causes vertical misalignment.
{{frac}}: 12 Clean semantics. Discouraged by WP:MOSMATH.
{{open-open}}: ਫਰਮਾ:Open-open
{{open-closed}}: ਫਰਮਾ:Open-closed
{{closed-open}}: ਫਰਮਾ:Closed-open
{{closed-closed}}: ਫਰਮਾ:Closed-closed
Semantically distinguishes intervals from other types of formula. Because the interval endpoints are coded as a single parameter, the semantics is a bit obscure.
Bra–ket notation:
{{ket}} |ψ
{{bra}} ψ|
{{bra-ket}} ψ|ξ
Semantically distinguishes bra–ket notation from other types of formula. Avoids complex html coding for angular bracket characters ⟨ &#amp;x27E8; or {{langle}}, ⟩ &#x27E9; or {{rangle}}, and vertical bar | &#124; and prevents incorrect usage of less-than/greater-than signs for these characters. Angular brackets may not render on all browsers.
{{vec}}: A Clean semantics. The arrow may not be precisely centered over certain letters
{{intmath}}: +∞
0
Clean semantics. Name differs from math/LaTeX coding conventions.
{{overset}}: A, ~A
{{underset}}: A, A~
Clean semantics. Produces bad spacing when combined with fraction templates.

Discussions[ਸੋਧੋ]

See also[ਸੋਧੋ]