From Logo Creation Wiki
Jump to: navigation, search

This is a ShoutWiki help page, hosted at ShoutWiki Hub. If you want to suggest changes, leave a message on its talk page. If you want to replace this page with a custom help page for your wiki, click the create button above.

MediaWiki uses a subset of AMS-LaTeX markup, a superset of LaTeX markup which is in turn a superset of TeX markup, for mathematical formulae. By default, ShoutWiki uses the MathJax renderer, which uses a combination of HTML and CSS to display the equation. Alternatively, you can select it to generate PNG images or display as TeX for text browsers through your user preferences.


Math markup goes inside <math></math>.

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.

LaTeX commands[edit]

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[edit]

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[edit]

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.

Formatting using TeX[edit]

Functions, symbols, special characters[edit]


\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[edit]

\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[edit]

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[edit]

\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[edit]

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, \nleqq, \lneqq, \lvertneqq \le \leq, \lneq, \leqq, \nleqq, \lneqq, \lvertneqq \!
\ge \geq, \gneq, \geqq, \ngeqq, \gneqq, \gvertneqq \ge \geq, \gneq, \geqq, \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)[edit]

\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[edit]

Subscripts, superscripts, integrals[edit]

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

Fractions, matrices, multilines[edit]

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 \tfrac{2}{4} = 0.5 \tfrac{2}{4} = 0.5
Large (normal) fractions \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
Note does not work with MathJax
\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 \tbinom{n}{k} \tbinom{n}{k}
Large (normal) binomial coefficients \dbinom{n}{k} \dbinom{n}{k}
x & y \\
z & v
\begin{matrix} x & y \\ z & v
x & y \\
z & v
\begin{vmatrix} x & y \\ z & v
x & y \\
z & v
\begin{Vmatrix} x & y \\ z & v
0 & \cdots & 0 \\
\vdots & \ddots & \vdots \\
0 & \cdots & 0
\begin{bmatrix} 0 & \cdots & 0 \\ \vdots
& \ddots & \vdots \\ 0 & \cdots &
x & y \\
z & v
\begin{Bmatrix} x & y \\ z & v
x & y \\
z & v
\begin{pmatrix} 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 ({lcr}) (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
<math>f(x) \,\!</math>
<math>= \sum_{n=0}^\infty a_n x^n </math>
<math>= a_0+a_1x+a_2x^2+\cdots</math>
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
\begin{cases} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \end{cases}
\begin{array}{|c|c||c|} a & b & S \\

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

Parenthesizing big expressions, brackets, bars[edit]

Feature Syntax How it looks rendered
Bad ( \frac{1}{2} ) ( \frac{1}{2} )
Good \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

Alphabets and typefaces[edit]

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[edit]

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


Other methods only work with one renderer and will not work for readers with the other renderer

  • {\color{Blue}x^2}+{\color{Orange}2x}-{\color{LimeGreen}1} works with Texvc but not MathJax
  • \color{Blue}x^2\color{Black}+\color{Orange}2x\color{Black}-\color{LimeGreen}1 works with Texvc but not MathJax
  • \color{Blue}{x^2}+\color{Orange}{2x}-\color{LimeGreen}{1} works with MathJax but not Texvc

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}} \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}}
\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}}

: These colors do not work with the MathJax renderer and should generally be avoided.

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"
| 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.

Custom colours can be defined using

\definecolor{mycolor}{RGB}{255,165,100}\pagecolor{mycolor} e^{i \pi} + 1 = 0.

This should be avoided as it does not work with the MathJax renderer.

Formatting issues[edit]


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
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[edit]

Due to 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 style="vertical-align:-100%;">... 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.


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

Examples of implemented TeX formulas[edit]

Quadratic polynomial[edit]

ax^2 + bx + c = 0

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

Quadratic formula[edit]

x={-b\pm\sqrt{b^2-4ac} \over 2a}

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

Tall parentheses and fractions[edit]

2 = \left( \frac{\left(3-x\right) \times 2}{3-x} \right)

<math>2 = \left(
\frac{\left(3-x\right) \times 2}{3-x}

S_{\text{new}} = S_{\text{old}} - \frac{ \left( 5-T \right) ^2} {2}

<math>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>\int_a^x \!\!\!\int_a^s f(y)\,dy\,ds
= \int_a^x f(y)(x-y)\,dy</math>

Matrices and determinants[edit]

\det(\mathsf{A}-\lambda\mathsf{I}) = 0

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


\sum_{i=0}^{n-1} i

<math>\sum_{i=0}^{n-1} i</math>



Differential equation[edit]

u'' + p(x)u' + q(x)u=f(x),\quad x>a

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

Complex numbers[edit]

|\bar{z}| = |z|, |(\bar{z})^n| = |z|^n, \arg(z^n) = n \arg(z)

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


\lim_{z\rightarrow z_0} f(z)=f(z_0)

<math>\lim_{z\rightarrow z_0} f(z)=f(z_0)</math>

Integral equation[edit]

= \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) =
\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) = 0.033C_n^2\kappa^{-11/3},\quad \frac{1}{L_0}\ll\kappa\ll\frac{1}{l_0}

<math>\phi_n(\kappa) =

Continuation and cases[edit]

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

f(x) =
1 & -1 \le x < 0 \\
\frac{1}{2} & x = 0 \\
1 - x^2 & \text{otherwise}

Prefixed subscript[edit]

{}_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!}

= \sum_{n=0}^\infty

Fraction and small fraction[edit]

\frac{a}{b}\ \tfrac{a}{b}

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

Area of a quadrilateral[edit]



Volume of a sphere-stand[edit]

V=\frac16\pi h\left[3\left(r_1^2+r_2^2\right)+h^2\right]

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

Multiple equations[edit]

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)

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)

External links[edit]

There is currently no text in this page. You can search for this page title in other pages, search the related logs, or create this page.