Help:Displaying a formula

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

MediaWiki renders mathematical equations using a combination of html markup and a variant of LaTeX.

The version of LaTeX used is a subset of AMS-LaTeX markup, a superset of LaTeX markup which is in turn a superset of TeX markup, for mathematical formulae. More precisely, MediaWiki filters the markup through Texvc, which in turn passes the commands to TeX or MathJax for the actual rendering. Thus, only a limited part of the full TeX language is supported; see below for details.[lower-alpha 1]

By default Texvc is used to generate PNG images.[lower-alpha 2] Alternatively, a "MathML with SVG or PNG fallback" renderer can be selected in the user preferences; this generates MathML for Firefox and other browsers that support it, or SVG images for browsers that do not. Client side MathJax is no longer supported.

See mw:Extension:Math for details on setting up math rendering on MediaWiki installations.



Math markup goes inside <math>...</math>. Chemistry markup goes inside <math chem>...</math chem> or <ce>...</ce>. All these tags use TeX.

The TeX 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 m:Template:Demo of attempt to use parameters within TeX (backlinks edit) for more information.

LaTeX commands

LaTeX commands are case-sensitive, and take one of the following two formats:

  • They start with a backslash \ and then have a name consisting of letters only. Command names are terminated by a space, a number or any other "non-letter".
  • They consist of a backslash \ and exactly one non-letter.

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:


Special characters

The following symbols are reserved characters that either have a special meaning under LaTeX or are unavailable in all the fonts. If you enter them directly in your text, they will normally not render, but rather do things you did not intend.

# $ % ^ & _ { } ~ \

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.


"Whitespace" characters, such as blank or tab, are treated uniformly as "space" by LaTeX. Several consecutive whitespace characters are treated as one "space". See below for commands that produces spaces of different size.

LaTeX environments

Environments in LaTeX have a role that is quite similar to commands, but they usually have effect on a wider part of formula. Their syntax is:

   text to be influenced

Environments supported by Wikipedia include matrix, align, etc. See below.


e^{i \pi} + 1 = 0\,\! e^{i \pi} + 1 = 0\,\! \definecolor{olive}{RGB}{128,128,0}\pagecolor{olive}e^{i \pi} + 1 = 0\,\!

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; a work-around is described in the "Alignment with normal text flow" section below. The css selector of the images is img.tex.

The alt text 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 <math> and </math>. You can override this by explicitly specifying an alt attribute for the math element. For example, <math alt="Square root of pi">\sqrt{\pi}</math> generates an image square root of pi 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 <math title="pi">\pi</math> generates an image \pi 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, \text{abc} gives \text{abc}. \operatorname{...} provides spacing before and after the operator name when appropriate, as when a\operatorname{\sn}b is rendered as a\operatorname{sn}b (with space to the left and right of "sn") and a\operatorname{\sn}(b+c) as a\operatorname{sn}(b+c) (with space to the left and not to the right).

Latex does not have full support for Unicode characters and not all characters render. Most Latin characters with accents render correctly. However some do not, in particular 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), 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 and subscript letters. For example, \text{ð} or \mbox{ð}, and \text{þ} or \mbox{þ} (used in Icelandic) will give errors.

Force-rerendering of formulas

MediaWiki stores rendered formulas in a cache so that the images of those formulas do not need to be created each time the page is opened by a user. To force the rerendering of all formulas of a page, you must open it with the getter variables action=purge&mathpurge=true. Imagine for example there is a wrong rendered formula in the article Integral. To force the rerendering of this formula you need to open the URL . Afterwards you need to bypass your browser cache so that the new created images of the formulas are actually downloaded. See also mw:Extension:Math#Purging pages that contain equations for more details.


Before using TeX markup for producing special characters, it should be noted that, as this comparison table shows, sometimes similar results can be achieved in HTML using Template:Math. See also Help:Special characters.

TeX syntax TeX rendering HTML syntax HTML rendering
\alpha \alpha {{math|''&alpha;''}} α
f(x) = x^2  f(x) = x^2 {{math|''f''(''x'') {{=}} ''x''<sup>2</sup>}} f(x) = x2
\sqrt{2} \sqrt{2} {{math|{{radical|2}}}} 2
\sqrt{1-e^2} \sqrt{1-e^2}\! {{math|{{radical|1 &minus; ''e''<sup>2</sup>}}}} 1 − e2

The codes on the left produce the symbols on the right, but the latter can also be put directly in the wikitext, except for ‘=’.

HTML syntax Rendering
&alpha; &beta; &gamma; &delta; &epsilon; &zeta;
&eta; &theta; &iota; &kappa; &lambda; &mu; &nu;
&xi; &omicron; &pi; &rho; &sigma; &sigmaf;
&tau; &upsilon; &phi; &chi; &psi; &omega;

α β γ δ ε ζ
η θ ι κ λ μ ν
ξ ο π ρ σ ς
τ υ φ χ ψ ω

&Gamma; &Delta; &Theta; &Lambda; &Xi; &Pi;
&Sigma; &Phi; &Psi; &Omega;


&int; &sum; &prod; &radic; &minus; &plusmn; &infin;
&asymp; &prop; = &equiv; &ne; &le; &ge;
&times; &middot; &sdot; &divide; &part; &prime; &Prime;
&nabla; &permil; &deg; &there4; &empty;

∫ ∑ ∏ √ − ± ∞
≈ ∝ = ≡ ≠ ≤ ≥
× · ⋅ ÷ ∂ ′ ″
∇ ‰ ° ∴ ∅

&isin; &notin; &cap; &cup; &sub; &sup; &sube; &supe;
&not; &and; &or; &exist; &forall;
&rArr; &hArr; &rarr; &harr; &uarr; &darr;
&alefsym; - &ndash; &mdash;

∈ ∉ ∩ ∪ ⊂ ⊃ ⊆ ⊇
¬ ∧ ∨ ∃ ∀
⇒ ⇔ → ↔ ↑ ↓
ℵ - – —

The project has settled on using both HTML and TeX because each has advantages in some situations.

Pros of HTML

  1. Formulas in HTML behave more like regular text. In-line HTML formulae always align properly with the rest of the HTML text and, to some degree, can be copied-and-pasted (this is not a problem if TeX is rendered using MathJax, and the alignment should not be a problem for PNG rendering once bug 32694 is fixed).
  2. The formula’s background and font size match the rest of HTML contents (this can be fixed on TeX formulas by using the commands \pagecolor and \definecolor) and the appearance respects CSS and browser settings while the typeface is conveniently altered to help you identify formulae.
  3. Pages using HTML code for formulae will load faster and they will create less clutter on your hard disk.
  4. Formulae typeset with HTML code will be accessible to client-side script links (a.k.a. scriptlets).
  5. The display of a formula entered using mathematical templates can be conveniently altered by modifying the templates involved; this modification will affect all relevant formulae without any manual intervention.
  6. The HTML code, if entered diligently, will contain all semantic information to transform the equation back to TeX or any other code as needed. It can even contain differences TeX does not normally catch, e.g. {{math|''i''}} for the imaginary unit and {{math|<var>i</var>}} for an arbitrary index variable.
  7. Unlike generated bitmaps, HTML is not sensitive to dots per inch variances between viewing platforms.

Pros of TeX

  1. TeX is semantically more precise than HTML.
    1. In TeX, "x" means "mathematical variable "x", whereas in HTML "x" is generic and somewhat ambiguous.
    2. On the other hand, if you encode the same formula as "{{math|<var>x</var>}}", you get the same visual result x and no information is lost. This requires diligence and more typing that could make the formula harder to understand as you type it. However, since there are far more readers than editors, this effort is worth considering if no other rendering options are available (such as MathJax, which is available to logged-in users as a preferences opt-in).
  2. One consequence of point 1 is that TeX code can be transformed into HTML, but not vice versa.[1] This means that on the server side we can always transform a formula, based on its complexity and location within the text, user preferences, type of browser, etc. Therefore, where possible, all the benefits of HTML can be retained, together with the benefits of TeX. It is true that the current situation is not ideal, but that is not a good reason to drop information or contents. It is more a reason to help improve the situation.
  3. Another consequence of point 1 is that TeX can be converted to MathML (e.g. by MathJax) for browsers which support it, thus keeping its semantics and allowing the rendering to be better suited for the reader’s graphic device.
  4. TeX is the preferred text formatting language of most professional mathematicians, scientists, and engineers. It is easier to persuade them to contribute if they can write in TeX.
  5. TeX has been specifically designed for typesetting formulae, so input is easier and more natural if you are accustomed to it, and output is more aesthetically pleasing if you focus on a single formula rather than on the whole containing page.
  6. Once a formula is done correctly in TeX, it will render reliably, whereas the success of HTML formulae is somewhat dependent on browsers or versions of browsers. Another aspect of this dependency is fonts: the serif font used for rendering formulae is browser-dependent and it may be missing some important glyphs. While the browser is generally capable to substitute a matching glyph from a different font family, it need not be the case for combined glyphs (compare "" and " ").
  7. When writing in TeX, editors need not worry about whether this or that version of this or that browser supports this or that HTML entity. The burden of these decisions is put on the software. This does not hold for HTML formulae, which can easily end up being rendered wrongly or differently from the editor’s intentions on a different browser.[2]
  8. TeX formulae, by default, render larger and are usually more readable than HTML formulae and are not dependent on client-side browser resources, such as fonts, and so the results are more reliably WYSIWYG.
  9. While TeX does not assist you in finding HTML codes or Unicode values (which you can obtain by viewing the HTML source in your browser), copying and pasting from a TeX PNG image in Wikipedia into simple text will return the LaTeX source.
^ Unless your wikitext follows the style of point 1.2
^ The entity support problem is not limited to mathematical formulae though; it can be easily solved by using the corresponding characters instead of entities, as the character repertoire links do, except for cases where the corresponding glyphs are visually indiscernible (e.g. &ndash; for ‘–’ and &minus; for ‘−’).

In some cases it may be the best choice to use neither TeX nor the HTML substitutes, but instead the simple ASCII symbols of a standard keyboard (see hereafter, for an example).

Using MathML

The MathML/SVG renderer option, selectable through My Preferences - Appearance - Math will use MathML if the browser supports it and SVG images if not. Currently only Firefox supports MathML natively. The MediaWiki software converts the LaTeX source to MathML format which will then be rendered by the browser. Firefox depends on locally installed fonts, but can be expanded with the MathML-fonts to add support for the XITS Math font and the Latin Modern Math font. Google Chrome has no native MathML support, but there are extensions available that add support, usually by having MathJax interpret the MathML source.

Formatting using TeX

Functions, symbols, special characters


\dot{a}, \ddot{a}, \acute{a}, \grave{a} \dot{a}, \ddot{a}, \acute{a}, \grave{a} \!
\check{a}, \breve{a}, \tilde{a}, \bar{a} \check{a}, \breve{a}, \tilde{a}, \bar{a} \!
\hat{a}, \widehat{a}, \vec{a} \hat{a}, \widehat{a}, \vec{a} \!

Standard numerical functions

\exp_a b = a^b, \exp b = e^b, 10^m \exp_a b = a^b, \exp b = e^b, 10^m \!
\ln c, \lg d = \log e, \log_{10} f \ln c, \lg d = \log e, \log_{10} f \!
\sin a, \cos b, \tan c, \cot d, \sec e, \csc f \sin a, \cos b, \tan c, \cot d, \sec e, \csc f\!
\arcsin h, \arccos i, \arctan j \arcsin h, \arccos i, \arctan j \!
\sinh k, \cosh l, \tanh m, \coth n \sinh k, \cosh l, \tanh m, \coth n \!
\operatorname{sh}\,k, \operatorname{ch}\,l, \operatorname{th}\,m, \operatorname{coth}\,n \operatorname{sh}\,k, \operatorname{ch}\,l, \operatorname{th}\,m, \operatorname{coth}\,n \!
\operatorname{argsh}\,o, \operatorname{argch}\,p, \operatorname{argth}\,q \operatorname{argsh}\,o, \operatorname{argch}\,p, \operatorname{argth}\,q \!
\sgn r, \left\vert s \right\vert \sgn r, \left\vert s \right\vert \!
\min(x,y), \max(x,y) \min(x,y), \max(x,y) \!


\min x, \max y, \inf s, \sup t \min x, \max y, \inf s, \sup t \!
\lim u, \liminf v, \limsup w \lim u, \liminf v, \limsup w \!
\dim p, \deg q, \det m, \ker\phi \dim p, \deg q, \det m, \ker\phi \!


\Pr j, \hom l, \lVert z \rVert, \arg z \Pr j, \hom l, \lVert z \rVert, \arg z \!

Differentials and derivatives

dt, \operatorname{d}\!t, \partial t, \nabla\psi 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 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'', f^{(3)}, \dot y, \ddot y \prime, \backprime, f^\prime, f', f'', f^{(3)} \!, \dot y, \ddot y

Letter-like symbols or constants

\infty, \aleph, \complement, \backepsilon, \eth, \Finv, \hbar \infty, \aleph, \complement, \backepsilon, \eth, \Finv, \hbar \!
\Im, \imath, \jmath, \Bbbk, \ell, \mho, \wp, \Re, \circledS \Im, \imath, \jmath, \Bbbk, \ell, \mho, \wp, \Re, \circledS \!

Modular arithmetic

s_k \equiv 0 \pmod{m} s_k \equiv 0 \pmod{m} \!
a\,\bmod\,b a\,\bmod\,b \!
\gcd(m, n), \operatorname{lcm}(m, n) \gcd(m, n), \operatorname{lcm}(m, n)
\mid, \nmid, \shortmid, \nshortmid \mid, \nmid, \shortmid, \nshortmid \!


\surd, \sqrt{2}, \sqrt[n]{}, \sqrt[3]{x^3+y^3 \over 2} \surd, \sqrt{2}, \sqrt[n]{}, \sqrt[3]{x^3+y^3 \over 2} \!


+, -, \pm, \mp, \dotplus +, -, \pm, \mp, \dotplus \!
\times, \div, \divideontimes, /, \backslash \times, \div, \divideontimes, /, \backslash \!
\cdot, * \ast, \star, \circ, \bullet \cdot, * \ast, \star, \circ, \bullet \!
\boxplus, \boxminus, \boxtimes, \boxdot \boxplus, \boxminus, \boxtimes, \boxdot \!
\oplus, \ominus, \otimes, \oslash, \odot \oplus, \ominus, \otimes, \oslash, \odot\!
\circleddash, \circledcirc, \circledast \circleddash, \circledcirc, \circledast \!
\bigoplus, \bigotimes, \bigodot \bigoplus, \bigotimes, \bigodot \!


\{ \}, \O \empty \emptyset, \varnothing \{ \}, \O \empty \emptyset, \varnothing \!
\in, \notin \not\in, \ni, \not\ni \in, \notin \not\in, \ni, \not\ni \!
\cap, \Cap, \sqcap, \bigcap \cap, \Cap, \sqcap, \bigcap \!
\cup, \Cup, \sqcup, \bigcup, \bigsqcup, \uplus, \biguplus \cup, \Cup, \sqcup, \bigcup, \bigsqcup, \uplus, \biguplus \!
\setminus, \smallsetminus, \times \setminus, \smallsetminus, \times \!
\subset, \Subset, \sqsubset \subset, \Subset, \sqsubset \!
\supset, \Supset, \sqsupset \supset, \Supset, \sqsupset \!
\subseteq, \nsubseteq, \subsetneq, \varsubsetneq, \sqsubseteq \subseteq, \nsubseteq, \subsetneq, \varsubsetneq, \sqsubseteq \!
\supseteq, \nsupseteq, \supsetneq, \varsupsetneq, \sqsupseteq \supseteq, \nsupseteq, \supsetneq, \varsupsetneq, \sqsupseteq \!
\subseteqq, \nsubseteqq, \subsetneqq, \varsubsetneqq \subseteqq, \nsubseteqq, \subsetneqq, \varsubsetneqq \!
\supseteqq, \nsupseteqq, \supsetneqq, \varsupsetneqq \supseteqq, \nsupseteqq, \supsetneqq, \varsupsetneqq \!


=, \ne, \neq, \equiv, \not\equiv =, \ne, \neq, \equiv, \not\equiv \!
\doteq, \doteqdot, \overset{\underset{\mathrm{def}}{}}{=}, := \doteq, \doteqdot, \overset{\underset{\mathrm{def}}{}}{=}, := \!
\sim, \nsim, \backsim, \thicksim, \simeq, \backsimeq, \eqsim, \cong, \ncong \sim, \nsim, \backsim, \thicksim, \simeq, \backsimeq, \eqsim, \cong, \ncong \!
\approx, \thickapprox, \approxeq, \asymp, \propto, \varpropto \approx, \thickapprox, \approxeq, \asymp, \propto, \varpropto \!
<, \nless, \ll, \not\ll, \lll, \not\lll, \lessdot <, \nless, \ll, \not\ll, \lll, \not\lll, \lessdot \!
>, \ngtr, \gg, \not\gg, \ggg, \not\ggg, \gtrdot >, \ngtr, \gg, \not\gg, \ggg, \not\ggg, \gtrdot \!
\le, \leq, \lneq, \leqq, \nleq, \nleqq, \lneqq, \lvertneqq \le, \leq, \lneq, \leqq, \nleq, \nleqq, \lneqq, \lvertneqq \!
\ge, \geq, \gneq, \geqq, \ngeq, \ngeqq, \gneqq, \gvertneqq \ge, \geq, \gneq, \geqq, \ngeq, \ngeqq, \gneqq, \gvertneqq \!
\lessgtr, \lesseqgtr, \lesseqqgtr, \gtrless, \gtreqless, \gtreqqless \lessgtr, \lesseqgtr, \lesseqqgtr, \gtrless, \gtreqless, \gtreqqless \!
\leqslant, \nleqslant, \eqslantless \leqslant, \nleqslant, \eqslantless \!
\geqslant, \ngeqslant, \eqslantgtr \geqslant, \ngeqslant, \eqslantgtr \!
\lesssim, \lnsim, \lessapprox, \lnapprox \lesssim, \lnsim, \lessapprox, \lnapprox \!
\gtrsim, \gnsim, \gtrapprox, \gnapprox \gtrsim, \gnsim, \gtrapprox, \gnapprox \,
\prec, \nprec, \preceq, \npreceq, \precneqq \prec, \nprec, \preceq, \npreceq, \precneqq \!
\succ, \nsucc, \succeq, \nsucceq, \succneqq \succ, \nsucc, \succeq, \nsucceq, \succneqq \!
\preccurlyeq, \curlyeqprec \preccurlyeq, \curlyeqprec \,
\succcurlyeq, \curlyeqsucc \succcurlyeq, \curlyeqsucc \,
\precsim, \precnsim, \precapprox, \precnapprox \precsim, \precnsim, \precapprox, \precnapprox \,
\succsim, \succnsim, \succapprox, \succnapprox \succsim, \succnsim, \succapprox, \succnapprox \,


\parallel, \nparallel, \shortparallel, \nshortparallel \parallel, \nparallel, \shortparallel, \nshortparallel \!
\perp, \angle, \sphericalangle, \measuredangle, 45^\circ \perp, \angle, \sphericalangle, \measuredangle, 45^\circ \!
\Box, \blacksquare, \diamond, \Diamond \lozenge, \blacklozenge, \bigstar \Box, \blacksquare, \diamond, \Diamond \lozenge, \blacklozenge, \bigstar \!
\bigcirc, \triangle, \bigtriangleup, \bigtriangledown \bigcirc, \triangle, \bigtriangleup, \bigtriangledown \!
\vartriangle, \triangledown \vartriangle, \triangledown\!
\blacktriangle, \blacktriangledown, \blacktriangleleft, \blacktriangleright \blacktriangle, \blacktriangledown, \blacktriangleleft, \blacktriangleright \!


\forall, \exists, \nexists \forall, \exists, \nexists \!
\therefore, \because, \And \therefore, \because, \And \!
\or \lor \vee, \curlyvee, \bigvee \or \lor \vee, \curlyvee, \bigvee \!
\and \land \wedge, \curlywedge, \bigwedge \and \land \wedge, \curlywedge, \bigwedge \!
\bar{q}, \bar{abc}, \overline{q}, \overline{abc},

\lnot \neg, \not\operatorname{R}, \bot, \top

\bar{q}, \bar{abc}, \overline{q}, \overline{abc}, \!

\lnot \neg, \not\operatorname{R}, \bot, \top \!

\vdash \dashv, \vDash, \Vdash, \models \vdash \dashv, \vDash, \Vdash, \models \!
\Vvdash \nvdash \nVdash \nvDash \nVDash \Vvdash \nvdash \nVdash \nvDash \nVDash \!
\ulcorner \urcorner \llcorner \lrcorner \ulcorner \urcorner \llcorner \lrcorner \,


\Rrightarrow, \Lleftarrow \Rrightarrow, \Lleftarrow \!
\Rightarrow, \nRightarrow, \Longrightarrow \implies \Rightarrow, \nRightarrow, \Longrightarrow \implies\!
\Leftarrow, \nLeftarrow, \Longleftarrow \Leftarrow, \nLeftarrow, \Longleftarrow \!
\Leftrightarrow, \nLeftrightarrow, \Longleftrightarrow \iff \Leftrightarrow, \nLeftrightarrow, \Longleftrightarrow \iff \!
\Uparrow, \Downarrow, \Updownarrow \Uparrow, \Downarrow, \Updownarrow \!
\rightarrow \to, \nrightarrow, \longrightarrow \rightarrow \to, \nrightarrow, \longrightarrow\!
\leftarrow \gets, \nleftarrow, \longleftarrow \leftarrow \gets, \nleftarrow, \longleftarrow\!
\leftrightarrow, \nleftrightarrow, \longleftrightarrow \leftrightarrow, \nleftrightarrow, \longleftrightarrow \!
\uparrow, \downarrow, \updownarrow \uparrow, \downarrow, \updownarrow \!
\nearrow, \swarrow, \nwarrow, \searrow \nearrow, \swarrow, \nwarrow, \searrow \!
\mapsto, \longmapsto \mapsto, \longmapsto \!
\rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft \upharpoonright \downharpoonleft \downharpoonright \rightleftharpoons \leftrightharpoons \rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft \upharpoonright \downharpoonleft \downharpoonright \rightleftharpoons \leftrightharpoons \,\!
\curvearrowleft \circlearrowleft \Lsh \upuparrows \rightrightarrows \rightleftarrows \rightarrowtail \looparrowright \curvearrowleft \circlearrowleft \Lsh \upuparrows \rightrightarrows \rightleftarrows \rightarrowtail \looparrowright \,\!
\curvearrowright \circlearrowright \Rsh \downdownarrows \leftleftarrows \leftrightarrows \leftarrowtail \looparrowleft \curvearrowright \circlearrowright \Rsh \downdownarrows \leftleftarrows \leftrightarrows \leftarrowtail \looparrowleft \,\!
\hookrightarrow \hookleftarrow \multimap \leftrightsquigarrow \rightsquigarrow \twoheadrightarrow \twoheadleftarrow \hookrightarrow \hookleftarrow \multimap \leftrightsquigarrow \rightsquigarrow \twoheadrightarrow \twoheadleftarrow \!


\amalg \P \S \% \dagger \ddagger \ldots \cdots \amalg \P \S \% \dagger \ddagger \ldots \cdots \!
\smile \frown \wr \triangleleft \triangleright \smile \frown \wr \triangleleft \triangleright\!
\diamondsuit, \heartsuit, \clubsuit, \spadesuit, \Game, \flat, \natural, \sharp \diamondsuit, \heartsuit, \clubsuit, \spadesuit, \Game, \flat, \natural, \sharp \!

Unsorted (new stuff)

\diagup \diagdown \centerdot \ltimes \rtimes \leftthreetimes \rightthreetimes \diagup \diagdown \centerdot \ltimes \rtimes \leftthreetimes \rightthreetimes \!
\eqcirc \circeq \triangleq \bumpeq \Bumpeq \doteqdot \risingdotseq \fallingdotseq \eqcirc \circeq \triangleq \bumpeq \Bumpeq \doteqdot \risingdotseq \fallingdotseq \!
\intercal \barwedge \veebar \doublebarwedge \between \pitchfork \intercal \barwedge \veebar \doublebarwedge \between \pitchfork \!
\vartriangleleft \ntriangleleft \vartriangleright \ntriangleright \vartriangleleft \ntriangleleft \vartriangleright \ntriangleright \!
\trianglelefteq \ntrianglelefteq \trianglerighteq \ntrianglerighteq \trianglelefteq \ntrianglelefteq \trianglerighteq \ntrianglerighteq \!

For a little more semantics on these symbols, see the brief TeX Cookbook.

Larger expressions

Subscripts, superscripts, integrals

Feature Syntax How it looks rendered
Superscript a^2 a^2
Subscript a_2 a_2
Grouping 10^{30} a^{2+2} 10^{30} a^{2+2}
a_{i,j} b_{f'} a_{i,j} b_{f'}
Combining sub & super without and with horizontal separation x_2^3 x_2^3
{x_2}^3 {x_2}^3 \,\!
Super super 10^{10^{8}} 10^{10^{8}}
Preceding and/or additional sub & super \sideset{_1^2}{_3^4}\prod_a^b \sideset{_1^2}{_3^4}\prod_a^b
{}_1^2\!\Omega_3^4 {}_1^2\!\Omega_3^4
Stacking \overset{\alpha}{\omega} \overset{\alpha}{\omega}
\underset{\alpha}{\omega} \underset{\alpha}{\omega}
\overset{\alpha}{\underset{\gamma}{\omega}} \overset{\alpha}{\underset{\gamma}{\omega}}
\stackrel{\alpha}{\omega} \stackrel{\alpha}{\omega}
Derivatives x', y'', f', f'' x', y'', f', f''
x^\prime, y^{\prime\prime} x^\prime, y^{\prime\prime}
Derivative dots \dot{x}, \ddot{x} \dot{x}, \ddot{x}
Underlines, overlines, vectors \hat a \ \bar b \ \vec c  \hat a \ \bar b \ \vec c
\overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f}  \overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f}
\overline{g h i} \ \underline{j k l}  \overline{g h i} \ \underline{j k l}
Arc (workaround) \overset{\frown} {AB} \overset{\frown} {AB}
Arrows A \xleftarrow{n+\mu-1} B \xrightarrow[T]{n\pm i-1} C  A \xleftarrow{n+\mu-1} B \xrightarrow[T]{n\pm i-1} C
Overbraces \overbrace{ 1+2+\cdots+100 }^{5050} \overbrace{ 1+2+\cdots+100 }^{5050}
Underbraces \underbrace{ a+b+\cdots+z }_{26} \underbrace{ a+b+\cdots+z }_{26}
Sum \sum_{k=1}^N k^2 \sum_{k=1}^N k^2
Sum (force \textstyle) \textstyle \sum_{k=1}^N k^2 \textstyle \sum_{k=1}^N k^2
Sum in a fraction (default \textstyle) \frac{\sum_{k=1}^N k^2}{a} \frac{\sum_{k=1}^N k^2}{a}
Sum in a fraction (force \displaystyle) \frac{\displaystyle \sum_{k=1}^N k^2}{a} \frac{\displaystyle \sum_{k=1}^N k^2}{a}
Sum in a fraction (alternative limits style) \frac{\sum\limits^{^N}_{k=1} k^2}{a} \frac{\sum\limits^{^N}_{k=1} k^2}{a}
Product \prod_{i=1}^N x_i \prod_{i=1}^N x_i
Product (force \textstyle) \textstyle \prod_{i=1}^N x_i \textstyle \prod_{i=1}^N x_i
Coproduct \coprod_{i=1}^N x_i \coprod_{i=1}^N x_i
Coproduct (force \textstyle) \textstyle \coprod_{i=1}^N x_i \textstyle \coprod_{i=1}^N x_i
Limit \lim_{n \to \infty}x_n \lim_{n \to \infty}x_n
Limit (force \textstyle) \textstyle \lim_{n \to \infty}x_n \textstyle \lim_{n \to \infty}x_n
Integral \int\limits_{1}^{3}\frac{e^3/x}{x^2}\, dx \int\limits_{1}^{3}\frac{e^3/x}{x^2}\, dx
Integral (alternative limits style) \int_{1}^{3}\frac{e^3/x}{x^2}\, dx \int_{1}^{3}\frac{e^3/x}{x^2}\, dx
Integral (force \textstyle) \textstyle \int\limits_{-N}^{N} e^x\, dx \textstyle \int\limits_{-N}^{N} e^x\, dx
Integral (force \textstyle, alternative limits style) \textstyle \int_{-N}^{N} e^x\, dx \textstyle \int_{-N}^{N} e^x\, dx
Double integral \iint\limits_D \, dx\,dy \iint\limits_D \, dx\,dy
Triple integral \iiint\limits_E \, dx\,dy\,dz \iiint\limits_E \, dx\,dy\,dz
Quadruple integral \iiiint\limits_F \, dx\,dy\,dz\,dt \iiiint\limits_F \, dx\,dy\,dz\,dt
Line or path integral \int_{(x,y)\in C} x^3\, dx + 4y^2\, dy \int_{(x,y)\in C} x^3\, dx + 4y^2\, dy
Closed line or path integral \oint_{(x,y)\in C} x^3\, dx + 4y^2\, dy \oint_{(x,y)\in C} x^3\, dx + 4y^2\, dy
Intersections \bigcap_{i=_1}^n E_i \bigcap_{i=_1}^n E_i
Unions \bigcup_{i=_1}^n E_i \bigcup_{i=_1}^n E_i


This screenshot shows the formula E = mc2 being edited using VisualEditor. The visual editor shows a button that allows to choose one of three offered modes to display a formula.

As an alternative to text- and displaystyle the display attribute of the math tag might be used. Possible settings are "inline" and "block".


If the value of the display attribute is inline, the contents will be rendered in inline mode; i.e., there will be no new paragraph for the equation and the operators will be rendered to consume only a small amount of vertical space.


The sum {\textstyle \sum_{i=0}^\infty 2^{-i}} converges to 2.

The next line-width is not disturbed by large operators.

The code for the math example reads:

<math display="inline">\sum_{i=0}^\infty 2^{-i}</math>
Technical implementation

Technically the command \textstyle will be added to the user input before the tex command is passed to the renderer. The result will be displayed without further formatting by outputting the image or MathMLelement to the page.


In block-style the equation is rendered in its own paragraph and the operators are rendered consuming less horizontal space.


The equation {\displaystyle \text{geometric series:}\quad \begin{align} \sum_{i=0}^\infty 2^{-i}=2 \end{align}} is used in a joke about mathematicians entering a bar and ordering beer.

It was entered as

<math display="block">\text{geometric series:}\quad \sum_{i=0}^\infty 2^{-i}=2 </math>
Technical implementation

Technically it will add the command \displaystyle will be added to the user input, if the user input does not contain the string \displaystyle or \align before the tex command is passed to the renderer. The result will be displayed in a new paragraph. Therefore, the style of the MathImage is altered i.e. the style attribute "display:block;margin:auto" is added. For MathML it is ensured that display=inline is replaced by display block which produces a new paragraph

Not specified

If nothing is specified the current behavior is preserved. That means all equations are rendered in display style but not using a new paragraph.


The sum \sum_{i=0}^\infty 2^{-i} converges to 2.

The next line-width is disturbed by large operators.

The code for the math example reads:

<math>\sum_{i=0}^\infty 2^{-i}</math>

The equation

\text{geometric series:}\quad \sum_{i=0}^\infty 2^{-i}=2

is used in a joke about mathematicians entering a bar and ordering beer.

It was entered as

<math>\text{geometric series:}\quad \sum_{i=0}^\infty 2^{-i}=2 </math>

Fractions, matrices, multilines

Feature Syntax How it looks rendered
Fractions \frac{2}{4}=0.5 or {2 \over 4}=0.5 \frac{2}{4}=0.5
Small fractions (force \textstyle) \tfrac{2}{4} = 0.5 \tfrac{2}{4} = 0.5
Large (normal) fractions (force \displaystyle) \dfrac{2}{4} = 0.5 \qquad \dfrac{2}{c + \dfrac{2}{d + \dfrac{2}{4}}} = a \dfrac{2}{4} = 0.5 \qquad \dfrac{2}{c + \dfrac{2}{d + \dfrac{2}{4}}} = a
Large (nested) fractions \cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a \cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a
Cancellations in fractions \cfrac{x}{1 + \cfrac{\cancel{y}}{\cancel{y}}} = \cfrac{x}{2} \cfrac{x}{1 + \cfrac{\cancel{y}}{\cancel{y}}} = \cfrac{x}{2}
Binomial coefficients \binom{n}{k} \binom{n}{k}
Small binomial coefficients (force \textstyle) \tbinom{n}{k} \tbinom{n}{k}
Large (normal) binomial coefficients (force \displaystyle) \dbinom{n}{k} \dbinom{n}{k}
x & y \\
z & v
x & y \\
z & v
x & y \\
z & v
x & y \\
z & v
x & y \\
z & v
x & y \\
z & v
0 & \cdots & 0 \\
\vdots & \ddots & \vdots \\
0 & \cdots & 0
0 & \cdots & 0 \\
\vdots & \ddots & \vdots \\
0 & \cdots & 0
x & y \\
z & v
x & y \\
z & v
x & y \\
z & v
x & y \\
z & v
\bigl( \begin{smallmatrix}
a&b\\ c&d
\end{smallmatrix} \bigr)

\bigl( \begin{smallmatrix}
a&b\\ c&d
\end{smallmatrix} \bigr)
Case distinctions
f(n) =
n/2, & \text{if }n\text{ is even} \\
3n+1, & \text{if }n\text{ is odd}
f(n) =
n/2, & \text{if }n\text{ is even} \\
3n+1, & \text{if }n\text{ is odd}
Multiline equations
f(x) & = (a+b)^2 \\
& = a^2+2ab+b^2 \\

f(x) & = (a+b)^2 \\
& = a^2+2ab+b^2 \\
f(x) & = (a-b)^2 \\
& = a^2-2ab+b^2 \\

f(x) & = (a-b)^2 \\
& = a^2-2ab+b^2 \\
Multiline equations (must define number of columns used ({lcl})) (should not be used unless needed)
z & = & a \\
f(x,y,z) & = & x + y + z
z & = & a \\
f(x,y,z) & = & x + y + z
Multiline equations (more)
z & = & a \\
f(x,y,z) & = & x + y + z
z & = & a \\
f(x,y,z) & = & x + y + z
Breaking up a long expression so that it wraps when necessary, at the expense of destroying correct spacing
f(x) =
\sum_{n=0}^\infty a_n x^n =
f(x) =
\sum_{n=0}^\infty a_n x^n =
a_0 +a_1x+a_2x^2+\cdots
Simultaneous equations
3x + 5y + z \\
7x - 2y + 4z \\
-6x + 3y + 2z
3x + 5y + z \\
7x - 2y + 4z \\
-6x + 3y + 2z
\begin{array}{|c|c|c|} a & b & S \\

\begin{array}{|c|c|c|} a & b & S \\

Parenthesizing big expressions, brackets, bars

Feature Syntax How it looks rendered
NBad ( \frac{1}{2} ) ( \frac{1}{2} )
GoodYesY \left ( \frac{1}{2} \right ) \left ( \frac{1}{2} \right )

You can use various delimiters with \left and \right:

Feature Syntax How it looks rendered
Parentheses \left ( \frac{a}{b} \right ) \left ( \frac{a}{b} \right )
Brackets \left [ \frac{a}{b} \right ] \quad
\left \lbrack \frac{a}{b} \right \rbrack
\left [ \frac{a}{b} \right ] \quad \left \lbrack \frac{a}{b} \right \rbrack
Braces \left \{ \frac{a}{b} \right \} \quad
\left \lbrace \frac{a}{b} \right \rbrace
\left \{ \frac{a}{b} \right \} \quad \left \lbrace \frac{a}{b} \right \rbrace
Angle brackets \left \langle \frac{a}{b} \right \rangle \left \langle \frac{a}{b} \right \rangle
Bars and double bars \left | \frac{a}{b} \right \vert \quad
\left \Vert \frac{c}{d} \right \|
\left | \frac{a}{b} \right \vert \quad \left \Vert \frac{c}{d} \right \|
Floor and ceiling functions: \left \lfloor \frac{a}{b} \right \rfloor \quad
\left \lceil \frac{c}{d} \right \rceil
\left \lfloor \frac{a}{b} \right \rfloor \quad \left \lceil \frac{c}{d} \right \rceil
Slashes and backslashes \left / \frac{a}{b} \right \backslash \left / \frac{a}{b} \right \backslash
Up, down, and up-down arrows \left \uparrow \frac{a}{b} \right \downarrow \quad
\left \Uparrow \frac{a}{b} \right \Downarrow \quad
\left \updownarrow \frac{a}{b} \right \Updownarrow
\left \uparrow \frac{a}{b} \right \downarrow \quad \left \Uparrow \frac{a}{b} \right \Downarrow \quad \left \updownarrow \frac{a}{b} \right \Updownarrow
Delimiters can be mixed,
as long as \left and \right match
\left [ 0,1 \right )
\left \langle \psi \right |
\left [ 0,1 \right )
\left \langle \psi \right |
Use \left. and \right. if you
do not want a delimiter to appear
\left . \frac{A}{B} \right \} \to X \left . \frac{A}{B} \right \} \to X
Size of the delimiters (add "l" or "r" to indicate the side for proper spacing) ( \bigl( \Bigl( \biggl( \Biggl( \dots \Biggr] \biggr] \Bigr] \bigr] ] ( \bigl( \Bigl( \biggl( \Biggl( \dots \Biggr] \biggr] \Bigr] \bigr] ]
\{ \bigl\{ \Bigl\{ \biggl\{ \Biggl\{ \dots
\Biggr\rangle \biggr\rangle \Bigr\rangle \bigr\rangle \rangle
\{ \bigl\{ \Bigl\{ \biggl\{ \Biggl\{ \dots \Biggr\rangle \biggr\rangle \Bigr\rangle \bigr\rangle \rangle
\| \big\| \Big\| \bigg\| \Bigg\| \dots \Bigg| \bigg| \Big| \big| | \| \big\| \Big\| \bigg\| \Bigg\| \dots \Bigg| \bigg| \Big| \big| |
\lfloor \bigl\lfloor \Bigl\lfloor \biggl\lfloor \Biggl\lfloor \dots
\Biggr\rceil \biggr\rceil \Bigr\rceil \bigr\rceil \ceil
\lfloor \bigl\lfloor \Bigl\lfloor \biggl\lfloor \Biggl\lfloor \dots \Biggr\rceil \biggr\rceil \Bigr\rceil \bigr\rceil \rceil
\uparrow \big\uparrow \Big\uparrow \bigg\uparrow \Bigg\uparrow \dots
\Bigg\Downarrow \bigg\Downarrow \Big\Downarrow \big\Downarrow \Downarrow
\uparrow \big\uparrow \Big\uparrow \bigg\uparrow \Bigg\uparrow \dots \Bigg\Downarrow \bigg\Downarrow \Big\Downarrow \big\Downarrow \Downarrow
\updownarrow \big\updownarrow \Big\updownarrow \bigg\updownarrow \Bigg\updownarrow \dots
\Bigg\Updownarrow \bigg\Updownarrow \Big\Updownarrow \big\Updownarrow \Updownarrow
\updownarrow \big\updownarrow \Big\updownarrow \bigg\updownarrow \Bigg\updownarrow \dots \Bigg\Updownarrow \bigg\Updownarrow \Big\Updownarrow \big\Updownarrow \Updownarrow
/ \big/ \Big/ \bigg/ \Bigg/ \dots
\Bigg\backslash \bigg\backslash \Big\backslash \big\backslash \backslash
/ \big/ \Big/ \bigg/ \Bigg/ \dots \Bigg\backslash \bigg\backslash \Big\backslash \big\backslash \backslash

Equation numbering

The templates {{NumBlk}} and {{EquationRef}} can be used to number equations. The template {{EquationNote}} can be used to refer to a numbered equation from surrounding text. For example, the following syntax:

{{NumBlk|:|<math>x^2 + y^2 + z^2 = 1</math>|{{EquationRef|1}}}}

produces the following result (note the equation number in the right margin):

x^2 + y^2 + z^2 = 1






Later on, the text can refer to this equation by its number using syntax like this:

As seen in equation ({{EquationNote|1}}), blah blah blah...

The result looks like this:

As seen in equation (1), blah blah blah...

Note that the equation number produced by {{EquationNote}} is a link that the user can click to go immediately to the cited equation.

Alphabets and typefaces

Texvc cannot render arbitrary Unicode characters. Those it can handle can be entered by the expressions below. For others, such as Cyrillic, they can be entered as Unicode or HTML entities in running text, but cannot be used in displayed formulas.

Greek alphabet
\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta \Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta \!
\Iota \Kappa \Lambda \Mu \Nu \Xi \Pi \Rho \Iota \Kappa \Lambda \Mu \Nu \Xi \Pi \Rho \!
\Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega \Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega \!
\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \alpha \beta \gamma \delta \epsilon \zeta \eta \theta \!
\iota \kappa \lambda \mu \nu \xi \pi \rho \iota \kappa \lambda \mu \nu \xi \pi \rho \!
\sigma \tau \upsilon \phi \chi \psi \omega \sigma \tau \upsilon \phi \chi \psi \omega \!
\varepsilon \digamma \varkappa \varpi \varepsilon \digamma \varkappa \varpi \!
\varrho \varsigma \vartheta \varphi \varrho \varsigma \vartheta \varphi \!
Hebrew symbols
\aleph \beth \gimel \daleth \aleph \beth \gimel \daleth \!
Blackboard bold/scripts
\mathbb{ABCDEFGHI} \mathbb{ABCDEFGHI} \!
\mathbb{JKLMNOPQR} \mathbb{JKLMNOPQR} \!
\mathbb{STUVWXYZ} \mathbb{STUVWXYZ} \!
\mathbf{ABCDEFGHI} \mathbf{ABCDEFGHI} \!
\mathbf{JKLMNOPQR} \mathbf{JKLMNOPQR} \!
\mathbf{STUVWXYZ} \mathbf{STUVWXYZ} \!
\mathbf{abcdefghijklm} \mathbf{abcdefghijklm} \!
\mathbf{nopqrstuvwxyz} \mathbf{nopqrstuvwxyz} \!
\mathbf{0123456789} \mathbf{0123456789} \!
Boldface (Greek)
\boldsymbol{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta} \boldsymbol{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta} \!
\boldsymbol{\Iota\Kappa\Lambda\Mu\Nu\Xi\Pi\Rho} \boldsymbol{\Iota\Kappa\Lambda\Mu\Nu\Xi\Pi\Rho} \!
\boldsymbol{\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \boldsymbol{\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \!
\boldsymbol{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta} \boldsymbol{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta} \!
\boldsymbol{\iota\kappa\lambda\mu\nu\xi\pi\rho} \boldsymbol{\iota\kappa\lambda\mu\nu\xi\pi\rho} \!
\boldsymbol{\sigma\tau\upsilon\phi\chi\psi\omega} \boldsymbol{\sigma\tau\upsilon\phi\chi\psi\omega} \!
\boldsymbol{\varepsilon\digamma\varkappa\varpi} \boldsymbol{\varepsilon\digamma\varkappa\varpi} \!
\boldsymbol{\varrho\varsigma\vartheta\varphi} \boldsymbol{\varrho\varsigma\vartheta\varphi} \!
Italics (default for Latin alphabet)
\mathit{0123456789} \mathit{0123456789} \!
Greek italics (default for lowercase Greek)
\mathit{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta} \mathit{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta} \!
\mathit{\Iota\Kappa\Lambda\Mu\Nu\Xi\Pi\Rho} \mathit{\Iota\Kappa\Lambda\Mu\Nu\Xi\Pi\Rho} \!
\mathit{\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \mathit{\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \!
Roman typeface
\mathrm{ABCDEFGHI} \mathrm{ABCDEFGHI} \!
\mathrm{JKLMNOPQR} \mathrm{JKLMNOPQR} \!
\mathrm{STUVWXYZ} \mathrm{STUVWXYZ} \!
\mathrm{abcdefghijklm} \mathrm{abcdefghijklm} \!
\mathrm{nopqrstuvwxyz} \mathrm{nopqrstuvwxyz} \!
\mathrm{0123456789} \mathrm{0123456789} \!
Sans serif
\mathsf{ABCDEFGHI} \mathsf{ABCDEFGHI} \!
\mathsf{JKLMNOPQR} \mathsf{JKLMNOPQR} \!
\mathsf{STUVWXYZ} \mathsf{STUVWXYZ} \!
\mathsf{abcdefghijklm} \mathsf{abcdefghijklm} \!
\mathsf{nopqrstuvwxyz} \mathsf{nopqrstuvwxyz} \!
\mathsf{0123456789} \mathsf{0123456789} \!
Sans serif Greek (capital only)
\mathsf{\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta} \mathsf{\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta} \!
\mathsf{\Iota \Kappa \Lambda \Mu \Nu \Xi \Pi \Rho} \mathsf{\Iota \Kappa \Lambda \Mu \Nu \Xi \Pi \Rho} \!
\mathsf{\Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega} \mathsf{\Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega}\!
\mathcal{ABCDEFGHI} \mathcal{ABCDEFGHI} \!
\mathcal{JKLMNOPQR} \mathcal{JKLMNOPQR} \!
\mathcal{STUVWXYZ} \mathcal{STUVWXYZ} \!
Fraktur typeface
\mathfrak{ABCDEFGHI} \mathfrak{ABCDEFGHI} \!
\mathfrak{JKLMNOPQR} \mathfrak{JKLMNOPQR} \!
\mathfrak{STUVWXYZ} \mathfrak{STUVWXYZ} \!
\mathfrak{abcdefghijklm} \mathfrak{abcdefghijklm} \!
\mathfrak{nopqrstuvwxyz} \mathfrak{nopqrstuvwxyz} \!
\mathfrak{0123456789} \mathfrak{0123456789} \!
Small scriptstyle text
{\scriptstyle\text{abcdefghijklm}} {\scriptstyle\text{abcdefghijklm}}

Mixed text faces

Feature Syntax How it looks rendered
Italicised characters (spaces are ignored) x y z x y z
Non-italicised characters \text{x y z} \text{x y z}
Mixed italics (bad) \text{if} n \text{is even} \text{if} n \text{is even}
Mixed italics (good) \text{if }n\text{ is even} \text{if }n\text{ is even}
Mixed italics (alternative: ~ or "\ " forces a space) \text{if}~n\ \text{is even} \text{if}~n\ \text{is even}


Equations can use color with the \color command. The default Texvc renderer and the MathJax renderers have different syntaxes to support both use {\color{Blue}{text}}. For example,

  • {\color{Blue}{x^2}}+{\color{Orange}{2x}}-{\color{LimeGreen}{1}}
  • x_{1,2}=\frac{{\color{Blue}{-b}}\pm\sqrt{\color{Red}{b^2-4ac}}}{\color{Green}{2a}}

There are several alternate notations styles

  • {\color{Blue}x^2}+{\color{Orange}2x}-{\color{LimeGreen}1} works with both texvc and MathJax
  • \color{Blue}x^2\color{Black}+\color{Orange}2x\color{Black}-\color{LimeGreen}1 works with both texvc and MathJax
  • \color{Blue}{x^2}+\color{Orange}{2x}-\color{LimeGreen}{1} only works with MathJax

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
\color{Apricot}{\text{Apricot}} \pagecolor{Gray}\color{Aquamarine}{\text{Aquamarine}} \color{Bittersweet}{\text{Bittersweet}} \color{Black}{\text{Black}}
\color{Blue}{\text{Blue}} \color{BlueGreen}{\text{BlueGreen}} \color{BlueViolet}{\text{BlueViolet}} \color{BrickRed}{\text{BrickRed}}
\color{Brown}{\text{Brown}} \color{BurntOrange}{\text{BurntOrange}} \color{CadetBlue}{\text{CadetBlue}} \color{CarnationPink}{\text{CarnationPink}}
\color{Cerulean}{\text{Cerulean}} \color{CornflowerBlue}{\text{CornflowerBlue}} \pagecolor{Gray}\color{Cyan}{\text{Cyan}} \color{Dandelion}{\text{Dandelion}}
\color{DarkOrchid}{\text{DarkOrchid}} \color{Emerald}{\text{Emerald}} \color{ForestGreen}{\text{ForestGreen}} \color{Fuchsia}{\text{Fuchsia}}
\color{Goldenrod}{\text{Goldenrod}} \color{Gray}{\text{Gray}} \color{Green}{\text{Green}} \pagecolor{Gray}\color{GreenYellow}{\text{GreenYellow}}
\color{JungleGreen}{\text{JungleGreen}} \pagecolor{Gray}\color{Lavender}{\text{Lavender}} \pagecolor{Gray}\color{LimeGreen}{\text{LimeGreen}} \color{Magenta}{\text{Magenta}}
\color{Mahogany}{\text{Mahogany}} \color{Maroon}{\text{Maroon}} \color{Melon}{\text{Melon}} \color{MidnightBlue}{\text{MidnightBlue}}
\color{Mulberry}{\text{Mulberry}} \color{NavyBlue}{\text{NavyBlue}} \color{OliveGreen}{\text{OliveGreen}} \color{Orange}{\text{Orange}}
\color{OrangeRed}{\text{OrangeRed}} \color{Orchid}{\text{Orchid}} \color{Peach}{\text{Peach}} \color{Periwinkle}{\text{Periwinkle}}
\color{PineGreen}{\text{PineGreen}} \color{Plum}{\text{Plum}} \color{ProcessBlue}{\text{ProcessBlue}} \color{Purple}{\text{Purple}}
\color{RawSienna}{\text{RawSienna}} \color{Red}{\text{Red}} \color{RedOrange}{\text{RedOrange}} \color{RedViolet}{\text{RedViolet}}
\color{Rhodamine}{\text{Rhodamine}} \color{RoyalBlue}{\text{RoyalBlue}} \color{RoyalPurple}{\text{RoyalPurple}} \color{RubineRed}{\text{RubineRed}}
\color{Salmon}{\text{Salmon}} \color{SeaGreen}{\text{SeaGreen}} \color{Sepia}{\text{Sepia}} \color{SkyBlue}{\text{SkyBlue}}
\pagecolor{Gray}\color{SpringGreen}{\text{SpringGreen}} \color{Tan}{\text{Tan}} \color{TealBlue}{\text{TealBlue}} \pagecolor{Gray}\color{Thistle}{\text{Thistle}}
\color{Turquoise}{\text{Turquoise}} \color{Violet}{\text{Violet}} \color{VioletRed}{\text{VioletRed}} \pagecolor{Gray}{\color{White}{\text{White}}}
\color{WildStrawberry}{\text{WildStrawberry}} \pagecolor{Gray}\color{Yellow}{\text{Yellow}} \color{YellowGreen}{\text{YellowGreen}} \color{YellowOrange}{\text{YellowOrange}}

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 Wikipedia:Manual of Style (accessibility)#Color.

Latex does not have a command for setting the background color. The most effective of setting a background color is by setting a CSS styling rules for a table cell

{| class="wikitable" align="center"
| style="background: gray;"      | <math>\pagecolor{Gray}x^2</math>
| style="background: Goldenrod;" | <math>\pagecolor{Goldenrod}y^3</math>

Rendered as

\pagecolor{Gray}x^2 \pagecolor{Goldenrod}y^3

The \pagecolor{Goldenrod} command is necessary for the Texvc renderer to use the correct anti-aliasing around the edges of the semi-transparent images. Without the command a default (white) background color is used — below are shown the results displayed on non-white background.

{| class="wikitable"  align="center"
| style="background: gray;"      | <math>x^2</math>
| style="background: Goldenrod;" | <math>y^3</math>
x^2 y^3

Custom colours can be defined using

\definecolor{myorange}{rgb}{1,0.65,0.4}\color{myorange}e^{i \pi}\color{Black} + 1 = 0
\definecolor{myorange}{rgb}{1,0.65,0.4}\color{myorange}e^{i \pi}\color{Black} + 1 = 0

Formatting issues


Note that TeX handles most spacing automatically, but you may sometimes want manual control.

Feature Syntax How it looks rendered
double quad space a \qquad b a \qquad b
quad space a \quad b a \quad b
text space a\ b a\ b
text space without PNG conversion a \mbox{ } b a \mbox{ } b
large space a\;b a\;b
medium space a\<b [not supported]
small space a\,b a\,b
tiny space (use for multiplication of factors) ab ab
tiny space (syntax space ignored) a b a b
no space (use for multi-letter variables) \mathit{ab} \mathit{ab}
small negative space a\!b a\!b

Automatic spacing may be broken in very long expressions (because they produce an overfull hbox in TeX):


This can be remedied by putting a pair of braces { } around the whole expression:


Alignment with normal text flow

Because of the default CSS

img.tex { vertical-align: middle; }

an inline expression like \int_{-N}^{N} e^x\, dx should look good.

If you need to align it otherwise, use <math style="vertical-align:-100%;">...</math> and play with the vertical-align 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.

Commutative diagrams

A sample commutative diagram, created in the manner described

To make a commutative diagram, there are three steps:

  1. write the diagram in TeX
  2. convert to SVG
  3. upload the file to Wikimedia Commons

Diagrams in TeX

Xy-pic (online manual) is the most powerful and general-purpose diagram package in TeX. Diagrams created using it can be found at Commons: Category:Xy-pic diagrams.

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):

\usepackage[all, ps, dvips]{xy}  % Loading the XY-Pic package
                                 % Using postscript driver for smoother curves
\usepackage{color}  % For invisible frame
\thispagestyle{empty}  % No page numbers
\SelectTips{eu}{}  % Euler arrowheads (tips)
\setlength{\fboxsep}{0pt}  % Frame box margin
{\color{white}\framebox{{\color{black}$$  % Frame for margin

%%% Diagram goes here %%%

$$}}} % end math, end frame

Convert to SVG

Once you have produced your diagram in LaTeX (or TeX), you can convert it to an SVG file using the following sequence of commands:

pdflatex file.tex
pdfcrop --clip file.pdf tmp.pdf
pdf2svg tmp.pdf file.svg
rm tmp.pdf

The pdfcrop and pdf2svg utilities are needed for this procedure. You can alternatively use pdf2svg from PDFTron for the last step.

If you do not have pdfTeX (which is unlikely) you can use the following commands to replace the first step (TeX → PDF):

latex file.tex
dvipdfm file.dvi

In general, you will not be able to get anywhere with diagrams without TeX and Ghostscript, and the inkscape program is a useful tool for creating or modifying your diagrams by hand. There is also a utility pstoedit 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:

Upload the file

As the diagram is your own work, upload it to Wikimedia Commons, so that all projects (notably, all languages) can use it without having to copy it to their language's Wiki. (If you've previously uploaded a file to somewhere other than Commons, to Commons.)

Check size
Before uploading, check that the default size of the image is neither too large nor too small by opening in an SVG application and viewing at default size (100% scaling), otherwise adjust the -y option to dvips.
Make sure the file has a meaningful name.
Login to Wikimedia Commons, then upload the file; for the Summary, give a brief description.

Now go to the image page and add a description, including the source code, using this template:

|description =
{{en|1= Description [[:en:Link to WP page|topic]]
|source = {{own}}, created as per:
 [[:en:Help:Displaying a formula#Commutative diagrams]];
 source code below.
|date = The Creation Date, like 1999-12-31
|author = [[User:YourUserName|Your Real Name]]
|permission = {{self|PD-self (or other license)
    |author = [[User:YourUserName|Your Real Name]]}}
==TeX source==
<source lang=latex> % TeX source here </source> [[Category:Commutative diagrams]] [[Category:Xy-pic diagrams]] [[Category:Images with LaTeX source code]]
Source code
  • Include the source code in the image page, in the Source section of the {{Information}} template, so that the diagram can be edited in future.
  • Include the complete .tex file, not just the fragment, so future editors do not need to reconstruct a compilable file.
  • You may optionally make the source code section collapsible, using the {{cot}}/{{cob}} templates.
  • (Don't include it in the Summary section, which is just supposed to be a summary.)
The most common license for commutative diagrams is PD-self; some use PD-ineligible, especially for simple diagrams, or other licenses. Please do not use the GFDL, as it requires the entire text of the GFDL to be attached to any document that uses the diagram.
If possible, link to a Wikipedia page relevant to the diagram. (The 1= is necessary if you use nest templates within the description, and harmless otherwise.)
Include [[Category:Commutative diagrams]], so that it appears in commons:Category:Commutative diagrams. There are also subcategories, which you may choose to use.
Include image
Now include the image on the original page via [[File:Diagram.svg]]


A sample conforming diagram is commons:Image:PSU-PU.svg.

Unimplemented elements and workarounds

\oiint and \oiiint

Elements which are not yet implemented are \oiint, a two-fold integral \iint (\iint) with a circular curve through the centre of the two integrals, and similarly \oiiint, a circular curve through three integrals. In contrast, \oint (\oint) exists for the single dimension (integration over a curved line within a plane or any space with higher dimension).

These elements appear in many contexts: \oiint 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 \oiiint denotes integration over the closed 3d boundary (surface volume) of a 4d region, and they would be strong candidates for the next TeX version. As such there are a lot of workarounds in the present version.

However, since no standardisation exists as yet, any workaround like this (which uses many \! symbols for backspacing) should be avoided, if possible. See below for a possibility using PNG image enforcement.

Note that \iint (the double integral) and \iiint (the triple integral) are still not kerned as they should preferably be, and are currently rendered as if they were successive \int 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).

\oiint and \oiiint as PNG images

These symbols are available as PNG images which are also integrated into two templates, {{oiint}} and {{oiiint}}, which take care of the formatting around the symbols.

The templates have three parameters:

the text or formula immediately before the integral
the subscript below the integral
the text or formula immediately after the integral
  • Stokes' theorem: {{oiint | intsubscpt = <math>{\scriptstyle S}</math> | integrand=<math>( \nabla \times \bold{F} ) \cdot {\rm d}\bold{S} = \oint_{\partial S} \bold{F} \cdot {\rm d}\boldsymbol{\ell} </math> }}
\oiint{\scriptstyle S} ( \nabla \times \bold{F} ) \cdot {\rm d}\bold{S} = \oint_{\partial S} \bold{F} \cdot {\rm d}\boldsymbol{\ell}
  • Ampère's law + correction: {{oiint | preintegral=<math>\oint_C \bold{B} \cdot {\rm d} \boldsymbol{\ell} = \mu_0 </math> | intsubscpt = <math>{\scriptstyle S}</math> | integrand = <math>\left ( \bold{J} + \epsilon_0\frac{\partial \bold{E}}{\partial t} \right ) \cdot {\rm d}\bold{S}</math> }}
\oint_{\partial S} \bold{B} \cdot {\rm d} \boldsymbol{\ell} = \mu_0 \oiint{\scriptstyle S} \left ( \bold{J} + \epsilon_0\frac{\partial \bold{E}}{\partial t} \right ) \cdot {\rm d}\bold{S}
  • Continuity of 4-momentum flux (in general relativity):[1]{{oiiint | preintegral=<math>\bold{P} = </math> | intsubscpt = <math>{\scriptstyle \partial \Omega}</math> | integrand = <math>\bold{T} \cdot {\rm d}^3\boldsymbol{\Sigma} = 0</math> }}
\bold{P} = \oiiint{\scriptstyle \partial \Omega} \bold{T} \cdot {\rm d}^3\boldsymbol{\Sigma} = 0
Oriented \oiint and \oiiint as PNG images

Some variants of \oiint and \oiiint have arrows on them to indicate the sense of integration, such as a line integral around a closed curve in the clockwise sense, and higher dimensional analogues. These are not implemented in TeX on Wikipedia either, although the template {{intorient}} is available - see link for details.


\overarc is not yet implemented to display the arc notation. However, there exists a workaround: use \overset{\frown}{AB}, which gives \overset{\frown}{AB}


\dddot is not implemented in the TexVC renderer but does work in MathJax. For a workaround use \overset{...}{x}, which gives \overset{...}{x}.

Syntax to avoid

The texvc processor accepts some non-standard syntax. These should be avoided as the MathJax based renderers do not support these syntax.


Texvc accepts % for representing percentages. This causes an error with MathJax and should be replaced with \% in all renderers.


In texvc spaces need to be represented inside the \textrm environment using \, \ and normal spaces are ignored i.e. \textrm{A\,B C} would render as A BC. In mathjax \textrm is an alias for \text which is renders its argument as normal text, hence \textrm{A\,B C} renders as A\,B C. To ensure compatibility between versions alway use the \text environment: \text{A B C}.

Unicode characters

Unicode characters like π work in MathML, and MathJax but not in texvc so should be avoided.


There are three ways to render chemical sum formulae as used in chemical equations:

  • <math chem>...</math>
  • <ce>...</ce>
  • {{chem}}

<ce>X</ce> is short for <math chem>\ce{X}</math>

(where X is a chemical sum formula)

Technically, <math chem>...</math> is a math tag with the extension mhchem enabled, according to the mathjax documentation.

Note, that the commands \cee and \cf are disabled, because they are marked as deprecated in the mhchem LaTeX package documentation.

Molecular and Condensed formula

mhchem {{chem}} Equivalent HTML
Markup Renders as






Markup Renders as






Markup Renders as







mhchem Equivalent {{chem}} and HTML
Markup Renders as


Markup Renders as






mhchem {{chem}} Equivalent HTML
Markup Renders as












Markup Renders as












Markup Renders as












Addition Compounds and Stoichiometric Numbers

mhchem {{chem}}
Markup Renders as




<ce>{CaSO4.1/2H2O} + 1\!1/2H2O -> CaSO4.2H2O</ce>

<ce>{CaSO4.1/2H2O} + 1\!1/2H2O -> CaSO4.2H2O</ce>

<ce>{25/2O2} + C8H18 -> {8CO2} + 9H2O</ce>

<ce>{25/2O2} + C8H18 -> {8CO2} + 9H2O</ce>

Markup Renders as




{{chem|Ca|S|O|4}}&middot;&frac12;{{chem|H|2|O}} + 1&frac12;{{chem|H|2|O}} &rarr; {{chem|Ca|S|O|4}}&middot;2{{chem|H|2|O}}

+ 1½H

{{frac|25|2}}{{chem|O|2}} + {{chem|C|8|H|18}} &rarr; 8{{chem|C|O|2}} + 9{{chem|H|2|O}}

+ C
→ 8CO
+ 9H

(Italic) Math

Oxidation States

Greek characters

mhchem Equivalent {{chem}} and HTML
Markup Renders as




Markup Renders as







States Subscripting is not IUPAC recommendation.

mhchem {{chem}}
Markup Renders as




Markup Renders as





Reaction Arrows

Comparison of arrow symbols
Markup Renders as











<math>\longleftrightarrow</math> <ce><-></ce>

<ce>A ->[x] B</ce></nowiki>
<ce>A ->[x] B</ce>
<ce>A ->[\text{text above}][\text{text below}] B</ce>
<ce>A ->[\text{text above}][\text{text below}] B</ce>
<ce>A ->[\ce{+H2O}] B</ce>
<ce>A ->[\ce{+H2O}] B</ce>

Further Examples Using Ordinary LaTeX tags

<math chem>\begin{align}
\ce{\overbrace{2Fe3O4}^{magnetite} + {1/2O2} ->}\ &{\color{Brown}\ce{\overbrace{3(\lambda-Fe2O3)}^{maghemite}}}\\
\ce{\underbrace{2Fe3O4}_{magnetite} + {1/2O2} ->}\ &{\color{Red}\ce{\underbrace{3(\alpha-Fe2O3)}_{hematite}}}
Failed to parse (unknown function "\begin"): \begin{align} \ce{\overbrace{2Fe3O4}^{magnetite} + {1/2O2} ->}\ &{\color{Brown}\ce{\overbrace{3(\lambda-Fe2O3)}^{maghemite}}}\\ \ce{\underbrace{2Fe3O4}_{magnetite} + {1/2O2} ->}\ &{\color{BrickRed}\ce{\underbrace{3(\alpha-Fe2O3)}_{hematite}}} \end{align}
To align the equations or color them, use <math chem> and \ce.

Examples of implemented TeX formulas

Quadratic polynomial

<math>ax^2 + bx + c = 0</math>
Renders as ax^2 + bx + c = 0

Quadratic formula

<math>x={-b\pm\sqrt{b^2-4ac} \over 2a}</math>
Renders as x={-b\pm\sqrt{b^2-4ac} \over 2a}

Tall parentheses and fractions

<math>2 = \left( \frac{\left(3-x\right) \times 2}{3-x} \right)</math>
Renders as 2 = \left( \frac{\left(3-x\right) \times 2}{3-x} \right)
<math>S_{\text{new}} = S_{\text{old}} - \frac{ \left( 5-T \right) ^2} {2}</math>
Renders as S_{\text{new}} = S_{\text{old}} - \frac{ \left( 5-T \right) ^2} {2}


<math>\int_a^x \!\!\!\int_a^s f(y)\,dy\,ds = \int_a^x f(y)(x-y)\,dy</math>
Renders as \int_a^x \!\!\!\int_a^s f(y)\,dy\,ds = \int_a^x f(y)(x-y)\,dy
<math>\int_e^{\infty}\frac 1{t(\ln t)^2}dt={\frac{-1}{\ln t}\,\Bigg\vert\,}_e^\infty=1</math>
Renders as \int_e^{\infty}\frac 1{t(\ln t)^2}dt={\frac{-1}{\ln t}\,\Bigg\vert\,}_e^\infty=1

Matrices and determinants

<math>\det(\mathsf{A}-\lambda\mathsf{I}) = 0</math>
Renders as \det(\mathsf{A}-\lambda\mathsf{I}) = 0


<math>\sum_{i=0}^{n-1} i</math>
Renders as \sum_{i=0}^{n-1} i
<math>\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n} {3^m\left(m\,3^n+n\,3^m\right)}</math>
Renders as \sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n}{3^m\left(m\,3^n+n\,3^m\right)}

Differential equation

<math>u'' + p(x)u' + q(x)u=f(x),\quad x>a</math>
Renders as u'' + p(x)u' + q(x)u=f(x),\quad x>a

Complex numbers


<math>|\bar{z}| = |z|,
|(\bar{z})^n| = |z|^n,
\arg(z^n) = n \arg(z)</math>
Renders as |\bar{z}| = |z|, |(\bar{z})^n| = |z|^n, \arg(z^n) = n \arg(z)


<math>\lim_{z\to z_0} f(z)=f(z_0)</math>
Renders as \lim_{z\to z_0} f(z)=f(z_0)

Integral equation


<math>\phi_n(\kappa) =
\frac{1}{4\pi^2\kappa^2} \int_0^\infty
\frac{\sin(\kappa R)}{\kappa R}
\frac{\partial}{\partial R}
\left [ R^2\frac{\partial D_n(R)}{\partial R} \right ] \,dR</math>
Renders as \phi_n(\kappa) =
\frac{1}{4\pi^2\kappa^2} \int_0^\infty
\frac{\sin(\kappa R)}{\kappa R}
\frac{\partial}{\partial R}
\left [ R^2\frac{\partial D_n(R)}{\partial R} \right ] \,dR



<math>\phi_n(\kappa) =
Renders as \phi_n(\kappa) = 0.033C_n^2\kappa^{-11/3},\quad \frac{1}{L_0}\ll\kappa\ll\frac{1}{l_0}

Continuation and cases


f(x) =
1 & -1 \le x < 0 \\
\frac{1}{2} & x = 0 \\
1 - x^2 & \text{otherwise}
Renders as f(x) = \begin{cases}1 & -1 \le x < 0 \\
\frac{1}{2} & x = 0 \\ 1 - x^2 & \text{otherwise}\end{cases}

Prefixed subscript


= \sum_{n=0}^\infty
Renders as {}_pF_q(a_1,\dots,a_p;c_1,\dots,c_q;z) = \sum_{n=0}^\infty \frac{(a_1)_n\cdots(a_p)_n}{(c_1)_n\cdots(c_q)_n}\frac{z^n}{n!}

Fraction and small fraction

<math>\frac{a}{b}\ \tfrac{a}{b}</math>
Renders as \frac{a}{b}\ \tfrac{a}{b}

Area of a quadrilateral

Renders as S=dD\,\sin\alpha\!

Volume of a sphere-stand

<math> V = \frac 16 \pi h \left [ 3 \left ( r_1^2 + r_2^2 \right ) + h^2 \right ] </math>
Renders as  V = \frac 16 \pi h \left [ 3 \left( r_1^2+r_2^2 \right) + h^2 \right ]

Multiple equations


u & = \tfrac{1}{\sqrt{2}}(x+y) \qquad & x &= \tfrac{1}{\sqrt{2}}(u+v) \\
v & = \tfrac{1}{\sqrt{2}}(x-y) \qquad & y &= \tfrac{1}{\sqrt{2}}(u-v)
Renders as \begin{align}
u & = \tfrac{1}{\sqrt{2}}(x+y) \qquad & x &= \tfrac{1}{\sqrt{2}}(u+v)\\
v & = \tfrac{1}{\sqrt{2}}(x-y) \qquad & y &= \tfrac{1}{\sqrt{2}}(u-v)

See also



  1. Although, in all cases mentioned, TeX 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 TeX images (more precisely: PNG images) for the equations, embedded into usual text, and with short TeX 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 TeX 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.
  2. This can cause difficulty with setting the baseline as vertical alignment with the surrounding text can also be a problem (see bug 32694)


  1. J. A. Wheeler; C. Misner; K. S. Thorne (1973). Gravitation (2nd ed.). W. H. Freeman & Co. ISBN 0-7167-0344-0.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>

External links

  • Oetiker, Tobias; Partl, Hubert; Hyna, Irene; Schlegl, Elisabeth (December 13, 2009), The Not So Short Introduction to LaTeX 2ε (PDF) (4.27 ed.)<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>. A paper introducing LaTeX — skip to page 49 for the math section. See page 63 for a complete reference list of symbols included in LaTeX and AMS-LaTeX.