Although, in all cases mentioned, is generated by compilation, and not by an interpreter program, there is one essential difference between, e.g., Knuth's TeX or Lamport's LaTeX and the present implementation: whereas in the first two cases the compiler typically generates an all-in-one printable output, which has the quality of a whole book with all chapters, sections and subsections, and where no line is "special", in the present case one has, typically, a mixture of images (more precisely: PNG images) for the equations, embedded into usual text, and with short elements usually replaced by HTML parts. As a consequence, in many cases TeX-elements, e.g. vector symbols, "stick out" below (or above) the text line. This "sticking out" is not the case in the above-mentioned original products, and the HTML-substitutes for small additions to the text are often insufficient in quality for many readers. In spite of these shortcomings, the present product characterized by "many embedded PNG-images" should be preferred for small texts, where the equations do not dominate.
More precisely, MediaWiki filters the markup through Texvc or MathJax, which in turn passes the commands to for the actual render. Thus, only a limited part of the full language is supported; see below for details.
To have math rendered in a particular MediaWiki installation, one has to set $wgUseTeX = true; in .
The code has to be put literally: MediaWiki templates, predefined templates, and parameters cannot be used within math tags: pairs of double braces are ignored and "#" gives an error message. However, math tags work in the then and else part of #if, etc. See for more information.
Some commands need an argument, which has to be given between curly braces { } after the command name. Some commands support optional parameters, which are added after the command name in square brackets . The general syntax is:
\commandname[option1,option2,...]{argument1}{argument2}...
# $ % ^ & _ { } ~ \
These characters can be entered by adding a prefix backslash:
\# \$ \% \textasciicircum{} \& \_ \{ \} \~{} \textbackslash{}
The other symbols and many more can be rendered with special commands in mathematical formulae or as accents.
The backslash character \ can not be entered by adding another backslash in front of it (\\); this sequence is used for line breaking. For introducing a backslash in math mode, you can use \backslash instead.
The command \~ produces a tilde which is placed over the next letter. For example \~n gives ñ. To produce just the character ~, use \~{} which places a ~ over an empty box. Alternatively \sim produces a large centred ~ which may be more appropriate in some situations, but may not render properly in simple expressions which are converted to HTML.
Similarly, the command \^ produces a hat over the next character, for example \^{o} produces ô. If you need in text to display the ^ symbol you have to use \textasciicircum.
\begin{environmentname}
text to be influenced
\end{environmentname}
Environments supported by Wikipedia include matrix, align, etc. See below.
By default, the PNG images are rendered black on white, with a transparent background. On darker backgrounds, the characters may show white edges. To remove these, match the PNG background color with the background color of the page using \pagecolor. However, black text on a dark background is hard to read and should be avoided altogether where possible.
The colors, as well as font sizes and types, are independent of browser settings or CSS. Font sizes and types will often deviate from what HTML renders. Vertical alignment with the surrounding text can also be a problem (see ). The css selector of the images is img.tex.
The of the PNG images, which is displayed to visually impaired and other readers who cannot see the images, and is also used when the text is selected and copied, defaults to the wikitext that produced the image, excluding the <nowiki></nowiki> and <nowiki></nowiki>. You can override this by explicitly specifying an alt attribute for the math element. For example, <nowiki></nowiki> generates an image whose alt text is "Square root of pi". This should not be confused with the title attribute that produces popup text when the hovering over the PNG image, for example <nowiki></nowiki> generates an image whose popup text is "pi".
Apart from function and operator names, as is customary in mathematics, variables and letters are in italics; digits are not. For other text, (like variable labels) to avoid being rendered in italics like variables, use \text, \mbox, or \mathrm. You can also define new function names using \operatorname{...}. For example, <nowiki></nowiki> gives . This does not work for special characters, they are ignored unless the whole <math> ... </math> expression is rendered in HTML:
See for details. Nevertheless, using \mbox instead of \text, more characters may have been supported in the past, but today both operators are supporting the same characters set. For example,
But some Latin letters are not supported, including those that include multiple diacritics (e.g. with Latin letters used in Vietnamese) or that cannot be precomposed into a single character (such as the uppercase Latin letter W with ring, even though the lowercase letter is supported as it is encoded as a precomposed character), or that use other diacritics (like the ogonek or the double grave accent, used in Central European languages like Polish, or the horn attached above some vowels in Vietnamese), or other modified letter forms (used in IPA notations, or African languages, or in medieval texts), some digram ligatures (like IJ in Dutch), or Latin letters borrowed from Greek, or small capitals, as well as superscripts abd subscript letters. For example \text{ð} or \mbox{ð}, and \mbox{þ} or \mbox{þ} (used in Icelandic) will give an error:
| <nowiki></nowiki> | <nowiki></nowiki> | ||
| <nowiki></nowiki> | <nowiki></nowiki> | ||
| <nowiki></nowiki> | <nowiki></nowiki> | ||
| <nowiki></nowiki> | <nowiki></nowiki> |
The codes on the left produce the symbols on the right, but the latter can also be put directly in the wikitext, except for ‘=’.
α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ ς τ υ φ χ ψ ω Γ Δ Θ Λ Ξ Π Σ Φ Ψ Ω | α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ ς τ υ φ χ ψ ω Γ Δ Θ Λ Ξ Π Σ Φ Ψ Ω |
∫ ∑ ∏ √ − ± ∞ ≈ ∝ ≡ ≠ ≤ ≥ × · ⋅ ÷ ∂ ′ ″ ∇ ‰ ° ∴ Ø ø | ∫ ∑ ∏ √ − ± ∞ ≈ ∝ = ≡ ≠ ≤ ≥ × · ⋅ ÷ ∂ ′ ″ ∇ ‰ ° ∴ Ø ø |
∈ ∉ ∩ ∪ ⊂ ⊃ ⊆ ⊇ ¬ ∧ ∨ ∃ ∀ ⇒ ⇔ → ↔ ↑ ℵ - – — | ∈ ∉ ∩ ∪ ⊂ ⊃ ⊆ ⊇ ¬ ∧ ∨ ∃ ∀ ⇒ ⇔ → ↔ ↑ ℵ - – — |
The project has settled on both HTML and because each has advantages in some situations.
In some cases it may be the best choice to use neither nor the HTML substitutes, but instead the simple ASCII symbols of a standard keyboard (see hereafter, for an example).
Alternatively to the preferences option, MathJax can also be selected using the mathJax user script. It is the basis for the global option, and hence more experimental but also more up to date. Bug reports are taken care of at the script's .
The quality of font rendering is dependent on your browser and operating system. Speed and appearance can be improved by installing the STIX fonts; for installation details see the MathJax font help page. Further information is also available at this page.
| \dot{a}, \ddot{a}, \acute{a}, \grave{a} | |
| \check{a}, \breve{a}, \tilde{a}, \bar{a} | |
| \hat{a}, \widehat{a}, \vec{a} | |
| \exp_a b = a^b, \exp b = e^b, 10^m | |
| \ln c, \lg d = \log e, \log_{10} f | |
| \sin a, \cos b, \tan c, \cot d, \sec e, \csc f | |
| \arcsin h, \arccos i, \arctan j | |
| \sinh k, \cosh l, \tanh m, \coth n | |
| \operatorname{sh}\,k, \operatorname{ch}\,l, \operatorname{th}\,m, \operatorname{coth}\,n | |
| \operatorname{argsh}\,o, \operatorname{argch}\,p, \operatorname{argth}\,q | |
| \sgn r, \left\vert s \right\vert | |
| \min(x,y), \max(x,y) | |
| \min x, \max y, \inf s, \sup t | |
| \lim u, \liminf v, \limsup w | |
| \dim p, \deg q, \det m, \ker\phi | |
| \Pr j, \hom l, \lVert z \rVert, \arg z | |
| dt, \operatorname{d}\!t, \partial t, \nabla\psi | |
| dy/dx, \operatorname{d}\!y/\operatorname{d}\!x, {dy \over dx}, {\operatorname{d}\!y\over\operatorname{d}\!x}, {\partial^2\over\partial x_1\partial x_2}y | |
| \prime, \backprime, f^\prime, f', f'<nowiki/>', f^{(3)}, \dot y, \ddot y | |
| \infty, \aleph, \complement, \backepsilon, \eth, \Finv, \hbar | |
| \Im, \imath, \jmath, \Bbbk, \ell, \mho, \wp, \Re, \circledS | |
| s_k \equiv 0 \pmod{m} | |
| a\,\bmod\,b | |
| \gcd(m, n), \operatorname{lcm}(m, n) | |
| \mid, \nmid, \shortmid, \nshortmid | |
| \surd, \sqrt{2}, \sqrt[n]{}, \sqrt[3]{x^3 y^3 \over 2} | |
| , -, \pm, \mp, \dotplus | |
| \times, \div, \divideontimes, /, \backslash | |
| \cdot, * \ast, \star, \circ, \bullet | |
| \boxplus, \boxminus, \boxtimes, \boxdot | |
| \oplus, \ominus, \otimes, \oslash, \odot | |
| \circleddash, \circledcirc, \circledast | |
| \bigoplus, \bigotimes, \bigodot | |
| \{ \}, \O \empty \emptyset, \varnothing | |
| \in, \notin \not\in, \ni, \not\ni | |
| \cap, \Cap, \sqcap, \bigcap | |
| \cup, \Cup, \sqcup, \bigcup, \bigsqcup, \uplus, \biguplus | |
| \setminus, \smallsetminus, \times | |
| \subset, \Subset, \sqsubset | |
| \supset, \Supset, \sqsupset | |
| \subseteq, \nsubseteq, \subsetneq, \varsubsetneq, \sqsubseteq | |
| \supseteq, \nsupseteq, \supsetneq, \varsupsetneq, \sqsupseteq | |
| \subseteqq, \nsubseteqq, \subsetneqq, \varsubsetneqq | |
| \supseteqq, \nsupseteqq, \supsetneqq, \varsupsetneqq | |
| =, \ne \neq, \equiv, \not\equiv | |
| \doteq, \doteqdot, \overset{\underset{\mathrm{def}}{}}{=}, := | |
| \sim, \nsim, \backsim, \thicksim, \simeq, \backsimeq, \eqsim, \cong, \ncong | |
| \approx, \thickapprox, \approxeq, \asymp, \propto, \varpropto | |
| <, \nless, \ll, \not\ll, \lll, \not\lll, \lessdot | |
| >, \ngtr, \gg, \not\gg, \ggg, \not\ggg, \gtrdot | |
| \le \leq, \lneq, \leqq, \nleqq, \lneqq, \lvertneqq | |
| \ge \geq, \gneq, \geqq, \ngeqq, \gneqq, \gvertneqq | |
| \lessgtr \lesseqgtr \lesseqqgtr \gtrless \gtreqless \gtreqqless | |
| \leqslant, \nleqslant, \eqslantless | |
| \geqslant, \ngeqslant, \eqslantgtr | |
| \lesssim, \lnsim, \lessapprox, \lnapprox | |
| \gtrsim, \gnsim, \gtrapprox, \gnapprox | |
| \prec, \nprec, \preceq, \npreceq, \precneqq | |
| \succ, \nsucc, \succeq, \nsucceq, \succneqq | |
| \preccurlyeq, \curlyeqprec | |
| \succcurlyeq, \curlyeqsucc | |
| \precsim, \precnsim, \precapprox, \precnapprox | |
| \succsim, \succnsim, \succapprox, \succnapprox | |
| \parallel, \nparallel, \shortparallel, \nshortparallel | |
| \perp, \angle, \sphericalangle, \measuredangle, 45^\circ | |
| \Box, \blacksquare, \diamond, \Diamond \lozenge, \blacklozenge, \bigstar | |
| \bigcirc, \triangle \bigtriangleup, \bigtriangledown | |
| \vartriangle, \triangledown | |
| \blacktriangle, \blacktriangledown, \blacktriangleleft, \blacktriangleright | |
| \forall, \exists, \nexists | |
| \therefore, \because, \And | |
| \or \lor \vee, \curlyvee, \bigvee | |
| \and \land \wedge, \curlywedge, \bigwedge | |
| \bar{q}, \bar{abc}, \overline{q}, \overline{abc}, \lnot \neg, \not\operatorname{R}, \bot, \top | |
| \vdash \dashv, \vDash, \Vdash, \models | |
| \Vvdash \nvdash \nVdash \nvDash \nVDash | |
| \ulcorner \urcorner \llcorner \lrcorner | |
| \Rrightarrow, \Lleftarrow | |
| \Rightarrow, \nRightarrow, \Longrightarrow \implies | |
| \Leftarrow, \nLeftarrow, \Longleftarrow | |
| \Leftrightarrow, \nLeftrightarrow, \Longleftrightarrow \iff | |
| \Uparrow, \Downarrow, \Updownarrow | |
| \rightarrow \to, \nrightarrow, \longrightarrow | |
| \leftarrow \gets, \nleftarrow, \longleftarrow | |
| \leftrightarrow, \nleftrightarrow, \longleftrightarrow | |
| \uparrow, \downarrow, \updownarrow | |
| \nearrow, \swarrow, \nwarrow, \searrow | |
| \mapsto, \longmapsto | |
| \rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft \upharpoonright \downharpoonleft \downharpoonright \rightleftharpoons \leftrightharpoons | |
| \curvearrowleft \circlearrowleft \Lsh \upuparrows \rightrightarrows \rightleftarrows \rightarrowtail \looparrowright | |
| \curvearrowright \circlearrowright \Rsh \downdownarrows \leftleftarrows \leftrightarrows \leftarrowtail \looparrowleft | |
| \hookrightarrow \hookleftarrow \multimap \leftrightsquigarrow \rightsquigarrow \twoheadrightarrow \twoheadleftarrow | |
| \amalg \P \S \% \dagger \ddagger \ldots \cdots | |
| \smile \frown \wr \triangleleft \triangleright | |
| \diamondsuit, \heartsuit, \clubsuit, \spadesuit, \Game, \flat, \natural, \sharp | |
| \diagup \diagdown \centerdot \ltimes \rtimes \leftthreetimes \rightthreetimes | |
| \eqcirc \circeq \triangleq \bumpeq \Bumpeq \doteqdot \risingdotseq \fallingdotseq | |
| \intercal \barwedge \veebar \doublebarwedge \between \pitchfork | |
| \vartriangleleft \ntriangleleft \vartriangleright \ntriangleright | |
| \trianglelefteq \ntrianglelefteq \trianglerighteq \ntrianglerighteq |
For a little more semantics on these symbols, see the brief TeX Cookbook.
| Superscript | ||
| Subscript | ||
| Grouping | ||
| Combining sub & super without and with horizontal separation | ||
| Super super | ||
| Preceding and/or additional sub & super | ||
| Stacking | ||
| Derivative (f in italics may overlap primes in HTML) | ||
| Derivative (wrong in HTML) | ||
| Derivative (wrong in PNG) | ||
| Derivative dots | ||
| Underlines, overlines, vectors | ||
| Arc (workaround) | ||
| Arrows | ||
| Overbraces | ||
| Underbraces | ||
| Sum | ||
| Sum (force a^2) | ||
| Sum in a fraction (default a_2) | ||
| Sum in a fraction (force 10^{30} a^{2 2}) | ||
| Product | ||
| Product (force a_{i,j} b_{f'}) | ||
| Coproduct | ||
| Coproduct (force x_2^3) | ||
| Limit | ||
| Limit (force {x_2}^3) | ||
| Integral | ||
| Integral (alternative limits style) | ||
| Integral (force 10^{10^{8}}) | ||
| Integral (force \sideset{_1^2}{_3^4}\prod_a^b, alternative limits style) | ||
| Double integral | ||
| Triple integral | ||
| Quadruple integral | ||
| Line or path integral | ||
| Closed line or path integral | ||
| Intersections | ||
| Unions | ||
| Fractions | {}_1^2\!\Omega_3^4 or \overset{\alpha}{\omega} | |
| Small fractions | \underset{\alpha}{\omega} | |
| Large (normal) fractions | \overset{\alpha}{\underset{\gamma}{\omega}} | |
| Large (nested) fractions | \stackrel{\alpha}{\omega} | |
| Cancellations in fractions | <nowiki></nowiki> | |
| Binomial coefficients | x^\prime, y^{\prime\prime} | |
| Small binomial coefficients | x\prime, y\prime\prime | |
| Large (normal) binomial coefficients | \dot{x}, \ddot{x} | |
| Matrices | \begin{matrix}
| |
\begin{vmatrix}
| ||
\begin{Vmatrix}
| ||
\begin{bmatrix}
| ||
\begin{Bmatrix}
| ||
\begin{pmatrix}
| ||
\bigl( \begin{smallmatrix}
| ||
| Case distinctions |
f(n) =
\begin{cases}
| |
| Multiline equations |
\begin{align}
| |
\begin{alignat}{2}
| ||
| Multiline equations (must define number of columns used ({lcr}) (should not be used unless needed) |
\begin{array}{lcl}
| |
| Multiline equations (more) |
\begin{array}{lcr}
| |
| Breaking up a long expression so that it wraps when necessary, at the expense of destroying correct spacing |
<math>
| |
| Simultaneous equations | \begin{cases}
| |
| Arrays |
\begin{array}{ |
| Bad | \hat a \ \bar b \ \vec c | |
| Good | \overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f} |
You can use various delimiters with \left and \right:
| Parentheses | \overline{g h i} \ \underline{j k l} | |
| Brackets | \overset{\frown} {AB} | |
| Braces | A \xleftarrow{n \mu-1} B \xrightarrow[T]{n\pm i-1} C | |
| Angle brackets | \overbrace{ 1 2 \cdots 100 }^{5050} | |
| Bars and double bars | \underbrace{ a b \cdots z }_{26} | |
| Floor and ceiling functions: | \sum_{k=1}^N k^2 | |
| Slashes and backslashes | \textstyle | |
| Up, down and up-down arrows | \textstyle \sum_{k=1}^N k^2 | |
| Delimiters can be mixed, as long as \left and \right match | \textstyle \frac{\sum_{k=1}^N k^2}{a} | \left [ 0,1 \right ) |
| Use \left. and \right. if you don't want a delimiter to appear: | \displaystyle | |
| Size of the delimiters | \frac{\displaystyle \sum_{k=1}^N k^2}{a} | |
| \prod_{i=1}^N x_i | ||
| \textstyle | ||
| \textstyle \prod_{i=1}^N x_i | ||
| \coprod_{i=1}^N x_i | ||
| \textstyle |
produces the following result (note the equation number in the right margin):
Later on, the text can refer to this equation by its number using syntax like this:
The result looks like this:
Note that the equation number produced by is a link that the user can click to go immediately to the cited equation.
| \textstyle | |
| \textstyle \lim_{n \to \infty}x_n | |
| \int\limits_{1}^{3}\frac{e^3/x}{x^2}\, dx | |
| \int_{1}^{3}\frac{e^3/x}{x^2}\, dx | |
| \textstyle | |
| \textstyle \int\limits_{-N}^{N} e^x\, dx | |
| \textstyle | |
| \textstyle \int_{-N}^{N} e^x\, dx | |
| \iint\limits_D \, dx\,dy | |
| \iiint\limits_E \, dx\,dy\,dz | |
| \iiiint\limits_F \, dx\,dy\,dz\,dt | |
| \int_{(x,y)\in C} x^3\, dx 4y^2\, dy | |
| \oint_{(x,y)\in C} x^3\, dx 4y^2\, dy | |
| \bigcap_{i=_1}^n E_i | |
| \bigcup_{i=_1}^n E_i | |
| \frac{2}{4}=0.5 | |
| {2 \over 4}=0.5 | |
| \tfrac{2}{4} = 0.5 | |
| \dfrac{2}{4} = 0.5 \qquad \dfrac{2}{c \dfrac{2}{d \dfrac{2}{4}}} = a | |
| \cfrac{2}{c \cfrac{2}{d \cfrac{2}{4}}} = a | |
| \cfrac{x}{1 \cfrac{\cancel{y}}{\cancel{y}}} = \cfrac{x}{2} | |
| \binom{n}{k} | |
| \tbinom{n}{k} | |
| \dbinom{n}{k} | |
| ( \frac{1}{2} ) | |
| \left ( \frac{1}{2} \right ) | |
| \left ( \frac{a}{b} \right ) | |
| \left [ \frac{a}{b} \right ] \quad \left \lbrack \frac{a}{b} \right \rbrack | |
| \left \{ \frac{a}{b} \right \} \quad \left \lbrace \frac{a}{b} \right \rbrace | |
| \left \langle \frac{a}{b} \right \rangle | |
| <nowiki></nowiki> | |
| \left \lfloor \frac{a}{b} \right \rfloor \left \lceil \frac{c}{d} \right \rceil | |
| \left / \frac{a}{b} \right \backslash | |
| \left \uparrow \frac{a}{b} \right \downarrow \quad \left \Uparrow \frac{a}{b} \right \Downarrow \quad \left \updownarrow \frac{a}{b} \right \Updownarrow | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| \left . \frac{A}{B} \right \} \to X | |
| \big( \Big( \bigg( \Bigg( \dots \Bigg] \bigg] \Big] \big]/<code> | <math>\big( \Big( \bigg( \Bigg( \dots \Bigg] \bigg] \Big] \big]</math> |- | <code>\big\{ \Big\{ \bigg\{ \Bigg\{ \dots \Bigg\rangle \bigg\rangle \Big\rangle \big\rangle | |
| <nowiki></nowiki> | |
| \big\lfloor \Big\lfloor \bigg\lfloor \Bigg\lfloor \dots \Bigg\rceil \bigg\rceil \Big\rceil \big\rceil | |
| \big\uparrow \Big\uparrow \bigg\uparrow \Bigg\uparrow \dots \Bigg\Downarrow \bigg\Downarrow \Big\Downarrow \big\Downarrow | |
| \big\updownarrow \Big\updownarrow \bigg\updownarrow \Bigg\updownarrow \dots \Bigg\Updownarrow \bigg\Updownarrow \Big\Updownarrow \big\Updownarrow | |
| \big / \Big / \bigg / \Bigg / \dots \Bigg\backslash \bigg\backslash \Big\backslash \big\backslash | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| <nowiki></nowiki> | |
| Italicised characters (spaces are ignored) | <nowiki></nowiki> | ||
| Non-italicised characters | <nowiki></nowiki> | ||
| Mixed italics (bad) | <nowiki></nowiki> | ||
| Mixed italics (good) | <nowiki></nowiki> | ||
| Mixed italics (alternative: ~ or "\ " forces a space) | <nowiki></nowiki> |
It is also possible to change the background color (since ), as in the following example. Note that in the second row, the text is actually rendered in black, but shows orange color fringes because the rendered PNG image generates antialising according to the declared background, instead of generating semi-transparent black pixels ; similar problems occur on the third and fourth rows (with black background) where the antialising pixels are even more visible because they are opaque but show shades between the black color of glyphs and the background color assumed by TeX. In all these cases, PNG images do not contain a true alpha channel render them correctly according to the effective background on which the image will be drawn. To solve this rendering problem, you still need to declare the background color of the cell in CSS style for the HTML code, as well as within the TeX code, each time the background color of the cell is not white, as shown in the last row where the orange backgrounds are declared in both places:
| <nowiki></nowiki> | Bad | |
| <nowiki></nowiki> | Bad | |
| <nowiki></nowiki> | Good |
Some color names are predeclared according to the following table, you can use them directly for the rendering of formulas or for declaring the intended color of the page background.
| Colors supported |
Note that color should not be used as the only way to identify something, because it will become meaningless on black-and-white media or for color-blind people. See Manual of Style #Color.
| double quad space | <nowiki></nowiki> | |
| quad space | <nowiki></nowiki> | |
| text space | <nowiki></nowiki> | |
| text space without PNG conversion | <nowiki></nowiki> | |
| large space | <nowiki></nowiki> | |
| medium space | <nowiki></nowiki> | not |
| small space | <nowiki></nowiki> | |
| no space | <nowiki></nowiki> | |
| small negative space | <nowiki></nowiki> |
Automatic spacing may be broken in very long expressions (because they produce an overfull hbox in ):
This can be remedied by putting a pair of braces { } around the whole expression:
an inline expression like should look good.
If you need to align it otherwise, use <nowiki></nowiki> and play with the <nowiki></nowiki> argument until you get it right; however, how it looks may depend on the browser and the browser settings.
Also note that if you rely on this workaround, if/when the rendering on the server gets fixed in future releases, as a result of this extra manual offset your formulae will suddenly be aligned incorrectly. So use it sparingly, if at all.
Simpler packages include:
The following is a template for Xy-pic, together with a hack to increase the margins in dvips, so that the diagram is not truncated by over-eager cropping (suggested in TUGboat: TUGboat, Volume 17 1996, No. 3):
\documentclass{amsart}
\usepackageall,{xy} % Loading the XY-Pic package
% Using postscript driver for smoother curves
\usepackage{color} % For invisible frame
\begin{document}
\thispagestyle{empty} % No page numbers
\SelectTips{eu}{} % Euler arrowheads (tips)
\setlength{\fboxsep}{0pt} % Frame box margin
{\color{white}\framebox} % end math, end frame
\end{document}
pdflatex file.tex
pdfcrop --clip file.pdf tmp.pdf
pdf2svg tmp.pdf file.svg
(rm tmp.pdf at the end)
If you do not have pdflatex (which is unlikely) you can also use the commands
latex file.tex
dvipdfm file.dvi
to get a PDF version of your diagram. The pdfcrop and pdf2svg utilities are needed for this procedure.
In general, you will not be able to get anywhere with diagrams without and Ghostscript, and the <nowiki></nowiki> program is a useful tool for creating or modifying your diagrams by hand. There is also a utility <nowiki></nowiki> which supports direct conversion from Postscript files to many vector graphics formats, but it requires a non-free plugin to convert to SVG, and regardless of the format, this editor has not been successful in using it to convert diagrams with diagonal arrows from TeX-created files.
These programs are:
</math>Information
|Description =
<math alt="Square root of pi">\sqrt{\pi}</math>en| '''Description <math title="pi">\pi</math>:en:Link to WP page|topic]]'''
}}
|Source=Created as per: <math>\text{abc}</math>:en:meta:Help:Displaying a formula#Commutative diagrams]]
<pre>
'''% TeX source here'''
</pre>
|Date = '''The Creation Date, like 1999-12-31'''
|Author = '''<math>User:YourUserName|Your Real Name]]'''
|Permission = <math>\begin{align}
\text{ AaȦȧÄäÁáÀàĀāÂâǍǎĂăÃãÅåẠạ } & \text{ ÆæǼǽ BbḂḃḄḅḆḇ CcĊċĆćĈĉČč Çç DdḊḋĎďḎḏḌḍ Ḑḑ } \\
\text{ EeĖėËëÉéÈèĒēÊêĚěĔĕẼẽẸẹ Ȩȩ } & \text{ FfḞḟ GgĠġḠḡĜĝǦǧĞğ HhḢḣḦḧĤĥȞȟḤḥẖḪḫ Ḩḩ } \\
\text{ IıİiÏïÍíÌìĪīÎîǏǐĬĭĨĩỊị } & \text{ JjĴĵ KkḰḱǨǩḲḳḴḵ Ķķ LlĹ弾ḶḷḺḻ ĻļŁł } \\
& \text{ MmṀṁḾḿṂṃ NnṄṅŃńŇňÑñṆṇṈṉ Ņņ} \\
\text{ OoȮȯÖöÓóÒòŌōÔôǑǒŎŏÕõỌọ } & \text{ ØøǾǿ Œœ PpṖṗṔṕ Qq RrṘṙŔŕŘřṚṛṞṟ Ŗŗ } \\
& \text{ SsṠṡŚśŜŝŠšṢṣ Şş ß TtṪṫẗŤťṬṭṮṯȚț Ţţ } \\
\text{ UuÜüÚúŰűÙùŪūÛûǓǔŬŭŨũŮůỤụ } & \text{ VvṼṽṾṿ WwẆẇẄẅẂẃẀẁŴŵẈẉẘ XxẊẋẌẍ } \\
\text{ YyẎẏŸÿÝýỲỳȲȳŶŷỸỹẙỴỵ } & \text{ ZzŻżŹźẐẑŽžẒẓẔẕ ·×÷ } \\
\end{align}</math>self|PD-self '''(or [[commons:Licensing#Well-known licenses|other license]])'''|author='''<math>\begin{align}
\mbox{ AaȦȧÄäÁáÀàĀāÂâǍǎĂăÃãÅåẠạ } & \text{ ÆæǼǽ BbḂḃḄḅḆḇ CcĊċĆćĈĉČč Çç DdḊḋĎďḎḏḌḍ Ḑḑ } \\
\mbox{ EeĖėËëÉéÈèĒēÊêĚěĔĕẼẽẸẹ Ȩȩ } & \text{ FfḞḟ GgĠġḠḡĜĝǦǧĞğ HhḢḣḦḧĤĥȞȟḤḥẖḪḫ Ḩḩ } \\
\mbox{ IıİiÏïÍíÌìĪīÎîǏǐĬĭĨĩỊị } & \text{ JjĴĵ KkḰḱǨǩḲḳḴḵ Ķķ LlĹ弾ḶḷḺḻ ĻļŁł } \\
& \text{ MmṀṁḾḿṂṃ NnṄṅŃńŇňÑñṆṇṈṉ Ņņ } \\
\mbox{ OoȮȯÖöÓóÒòŌōÔôǑǒŎŏÕõỌọ } & \text{ ØøǾǿ Œœ PpṖṗṔṕ Qq RrṘṙŔŕŘřṚṛṞṟ Ŗŗ } \\
& \text{ SsṠṡŚśŜŝŠšṢṣ Şş ß TtṪṫẗŤťṬṭṮṯȚț Ţţ } \\
\mbox{ UuÜüÚúŰűÙùŪūÛûǓǔŬŭŨũŮůỤụ } & \text{ VvṼṽṾṿ WwẆẇẄẅẂẃẀẁŴŵẈẉẘ XxẊẋẌẍ } \\
\text{ YyẎẏŸÿÝýỲỳȲȳŶŷỸỹẙỴỵ } & \text{ ZzŻżŹźẐẑŽžẒẓẔẕ ·×÷ } \\
\end{align}</math>User:YourUserName|Your Real Name]]'''}}
}}
<math>\alpha\,\!</math>
These elements appear in many contexts: <nowiki></nowiki> denotes a surface integral over the closed 2d boundary of a 3d region (which occurs in much of 3d vector calculus and physical applications – like Maxwell's equations), likewise <nowiki></nowiki> denotes integration over the closed 3d boundary (surface volume) of a 4d region, and they would be strong candidates for the next version. As such there are a lot of workarounds in the present version.
| !<nowiki></nowiki> and <nowiki></nowiki> using currently implemented symbols |
| <nowiki></nowiki> looks like:
<nowiki></nowiki> (should also be preferably more tightly kerned) looks more or less like:
|
However, since no standardisation exists as yet, any workaround like this (which uses many \text{if }n\text{ is even} symbols for backspacing) should be avoided, if possible. See below for a possibility using PNG image enforcement.
Note that \text{if}~n\ \text{is even} (the double integral) and {\color{Blue}x^2} {\color{YellowOrange}2x}-{\color{OliveGreen}1} (the triple integral) are still not kerned as they should preferably be, and are currently rendered as if they were successive x_{1,2}=\frac{-b\pm\sqrt{\color{Red}b^2-4ac}}{2a} symbols ; this is not a major problem for reading the formulas, even if the integral symbols before the last one do not have bounds, so it's best to avoid backspacing "hacks" as they may be inconsistent with a possible future better implementation of integrals symbols (with more precisely computed kerning positions).
The templates have three parameters:
However, generally image-enforcing should be avoided. Often the best choice is to use neither symbols nor the HTML substitutes, but instead the simple ASCII symbols offered by a standard keyboard: a good example is the quantity velocity, which might be given in (if necessary with an enforcement) by , with the HTML substitute (which, by the way, should not be mixed up with the Greek letter "\nu" ), and the ASCII letters v or V (i.e., one puts, at first, two primes for italic style, followed by the simple ASCII letter v or V, finally again two primes).
For vector or tensor quantities, one can use again ASCII letters plus three primes for bold printing.
Note also that the default HTML rendering of mathematic expressions (when they are possible) uses the default text font, weight, style and size for variable names. Some mathematical expressions need differences between these styles; for consistency with the more complex formulas using the same variables that can be rendered only as PNG, it may be necessary to enforce the PNG rendering also for isolated variables found in the article text (using one of the special spaces that remain invisible on the left or right of the expression and that force the PNG rendering wherever they occur in the expression, notably the backspace "\!").
{{math|''f''(<var>x</var>) {{=}} <var>x</var><sup>2</sup>}}
<math>\sqrt{2}</math>
{{math|{{radical|2}}}}
<math>\sqrt{1-e^2}</math>
{{math|{{radical|1 &minus; ''e''&sup2;}}}}
{{math|''i''}}
{{math|<var>i</var>}}
<math>x</math>
{{math|<var>x</var>}}
x', y'', f', f''
<math>f(x) \,\!</math>
<math>= \sum_{n=0}^\infty a_n x^n </math>
<math>= a_0 a_1x a_2x^2 \cdots</math>
\left | \frac{a}{b} \right \vert \left \Vert \frac{c}{d} \right \|
\left [ 0,1 \right )
\left \langle \psi \right |
\big\| \Big\| \bigg\| \Bigg\| \dots \Bigg| \bigg| \Big| \big|
{{NumBlk|:|<math>x^2 y^2 z^2 = 1 \,</math>|{{EquationRef|1}}}}
As seen in equation ({{EquationNote|1}}), blah blah blah...
\Alpha \Beta \Gamma \Delta \Epsilon \Zeta
\Eta \Theta \Iota \Kappa \Lambda \Mu
References