Help:Displaying a formula: Difference between revisions

Content deleted Content added
Line 50:
 
==Use of HTML templates==
{{Shortcut|WP:MATHSYMBOL}}
{{See also|Wikipedia:Rendering math}}
TeX markup is not the only way to render mathematical formulas. For simple inline formulas, the template {{tl|math}} and its associated templates are often preferred. The following comparison table shows that similar results can be achieved with the two methods. See also [[Help:Special characters]].
Line 82 ⟶ 81:
| {{math|{{abs|''z'' + 1}} ≤ 2}}
|}
 
===HTML entities===
 
Though Unicode characters are generally preferred, sometimes HTML entities are needed to avoid problems with wiki syntax or confusion with other characters:
 
{{aligned table|cols=10|style=text-align:center;|row1class=unicode|row2class=mw-code
| < | > | − | • |′ | ″ | ⋅ | ·| – | —
| < | > | − | • | ′ | ″ | ⋅ | · | – | — }}
 
In the table below, the codes on the left produce the symbols on the right, but these symbols can also be entered directly in the wikitext either by typing them if they are available on the keyboard, by copy-pasting them, or by using menus below the edit windows. (When editing any Wikipedia page in a desktop web browser, use the "Insert" pulldown menu immediately below the article text, or the "Special characters" menu immediately above the article text.) Normally, lowercase Greek letters should be entered in italics, that is, enclosed between two single quotes (<syntaxhighlight lang="html5" inline>''</syntaxhighlight>).
 
{| class="wikitable" border=1 <!--set border for MSIE browsers-->
|-
! HTML syntax
! Rendering
|- style="vertical-align:middle;"
|
<pre>&amp;alpha; &amp;beta; &amp;gamma; &amp;delta; &amp;epsilon; &amp;zeta;
&amp;eta; &amp;theta; &amp;iota; &amp;kappa; &amp;lambda; &amp;mu; &amp;nu;
&amp;xi; &amp;omicron; &amp;pi; &amp;rho; &amp;sigma; &amp;sigmaf;
&amp;tau; &amp;upsilon; &amp;phi; &amp;chi; &amp;psi; &amp;omega;</pre>
|
α β γ δ ε ζ<br>η θ ι κ λ μ ν<br>ξ ο π ρ σ ς<br>τ υ φ χ ψ ω<br>
|- style="vertical-align:middle;"
|
<pre>&amp;Gamma; &amp;Delta; &amp;Theta; &amp;Lambda; &amp;Xi; &amp;Pi;
&amp;Sigma; &amp;Phi; &amp;Psi; &amp;Omega;</pre>
|
Γ Δ Θ Λ Ξ Π<br>Σ Φ Ψ Ω
|- style="vertical-align:middle;"
| <pre>&amp;int; &amp;sum; &amp;prod; &amp;minus; &amp;plusmn; &amp;infin;
&amp;asymp; &amp;prop; = &amp;equiv; &amp;ne; &amp;le; &amp;ge;
&amp;times; &amp;middot; &amp;sdot; &amp;divide; &amp;part; &amp;prime; &amp;Prime;
&amp;nabla; &amp;permil; &amp;deg; &amp;there4; &amp;empty;</pre>
|
∫ ∑ ∏ − ± ∞<br/>≈ ∝ = ≡ ≠ ≤ ≥<br/>× · ⋅ ÷ ∂ ′ ″<br/>∇ ‰ ° ∴ ∅
|- style="vertical-align:middle;"
| <pre>&amp;isin; &amp;notin; &amp;cap; &amp;cup; &amp;sub; &amp;sup; &amp;sube; &amp;supe;
&amp;not; &amp;and; &amp;or; &amp;exist; &amp;forall;
&amp;rArr; &amp;hArr; &amp;rarr; &amp;harr; &amp;uarr; &amp;darr;
&amp;alefsym; - &amp;ndash; &amp;mdash;</pre>
|
∈ ∉ ∩ ∪ ⊂ ⊃ ⊆ ⊇<br>¬ ∧ ∨ ∃ ∀<br/>⇒ ⇔ → ↔ ↑ ↓<br/>ℵ - – —
|}
 
===Superscripts and subscripts===
{{aligned table|cols=3|style=text-align:center;|row1class=unicode|row2class=mw-code|x<sup>2</sup> | x<sub>3</sub> | x{{su|p=2|b=1}} |<nowiki>x<sup>2</sup></nowiki>|<nowiki>x<sub>3</sub></nowiki>|<nowiki>x{{su|p=2|b=1}}</nowiki>}}
 
===Spacing===
To avoid line-wrapping in the middle of a formula, use {{tl|math}}. If necessary, a non-breaking space (&nbsp;) can be inserted with "&amp;nbsp;".
 
Typically [[whitespace character|whitespace]] should be a regular space ( ) or none at all. In rare circumstances, such as where one character overlaps another due to one being in italics, a thin space can be added with {{tl|thin space}}.
 
== Fractions ==