Help:Math

From GoBots Wiki
Jump to navigationJump to 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.

Basics

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

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:

\commandname[option1,option2,...]{argument1}{argument2}...

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.

Spaces

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

 \begin{environmentname}
   text to be influenced
 \end{environmentname}

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

Formatting using TeX

Functions, symbols, special characters

Accents/diacritics

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

Standard numerical functions

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

Bounds

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

Projections

\Pr j, \hom l, \lVert z \rVert, \arg z <math>\Pr j, \hom l, \lVert z \rVert, \arg z \!</math>

Differentials and derivatives

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

Letter-like symbols or constants

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

Modular arithmetic

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

Radicals

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

Operators

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

Sets

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

Relations

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

Geometric

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

Logic

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

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

<math>\bar{q}, \bar{abc}, \overline{q}, \overline{abc}, \!</math>

<math>\lnot \neg, \not\operatorname{R}, \bot, \top \!</math>

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

Arrows

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

Special

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

Unsorted (new stuff)

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

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

Fractions, matrices, multilines

Feature Syntax How it looks rendered
Fractions \frac{2}{4}=0.5 or {2 \over 4}=0.5 <math>\frac{2}{4}=0.5</math>
Small fractions \tfrac{2}{4} = 0.5 <math>\tfrac{2}{4} = 0.5</math>
Large (normal) fractions \dfrac{2}{4} = 0.5 \qquad \dfrac{2}{c + \dfrac{2}{d + \dfrac{2}{4}}} = a <math>\dfrac{2}{4} = 0.5 \qquad \dfrac{2}{c + \dfrac{2}{d + \dfrac{2}{4}}} = a</math>
Large (nested) fractions \cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a <math>\cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a</math>
Cancellations in fractions
Note does not work with MathJax
\cfrac{x}{1 + \cfrac{\cancel{y}}{\cancel{y}}} = \cfrac{x}{2} <math>\cfrac{x}{1 + \cfrac{\cancel{y}}{\cancel{y}}} = \cfrac{x}{2}</math>
Binomial coefficients \binom{n}{k} <math>\binom{n}{k}</math>
Small binomial coefficients \tbinom{n}{k} <math>\tbinom{n}{k}</math>
Large (normal) binomial coefficients \dbinom{n}{k} <math>\dbinom{n}{k}</math>
Matrices
\begin{matrix}
x & y \\
z & v
\end{matrix}
<math>\begin{matrix} x & y \\ z & v

\end{matrix}</math>

\begin{vmatrix}
x & y \\
z & v
\end{vmatrix}
<math>\begin{vmatrix} x & y \\ z & v

\end{vmatrix}</math>

\begin{Vmatrix}
x & y \\
z & v
\end{Vmatrix}
<math>\begin{Vmatrix} x & y \\ z & v

\end{Vmatrix}</math>

\begin{bmatrix}
0 & \cdots & 0 \\
\vdots & \ddots & \vdots \\
0 & \cdots & 0
\end{bmatrix}
<math>\begin{bmatrix} 0 & \cdots & 0 \\ \vdots

& \ddots & \vdots \\ 0 & \cdots & 0\end{bmatrix} </math>

\begin{Bmatrix}
x & y \\
z & v
\end{Bmatrix}
<math>\begin{Bmatrix} x & y \\ z & v

\end{Bmatrix}</math>

\begin{pmatrix}
x & y \\
z & v
\end{pmatrix}
<math>\begin{pmatrix} x & y \\ z & v

\end{pmatrix}</math>

\bigl( \begin{smallmatrix}
a&b\\ c&d
\end{smallmatrix} \bigr)
<math>

\bigl( \begin{smallmatrix} a&b\\ c&d \end{smallmatrix} \bigr) </math>

Case distinctions
f(n) =
\begin{cases}
n/2, & \text{if }n\text{ is even} \\
3n+1, & \text{if }n\text{ is odd}
\end{cases}
<math>f(n) =

\begin{cases} n/2, & \text{if }n\text{ is even} \\ 3n+1, & \text{if }n\text{ is odd} \end{cases} </math>

Multiline equations
\begin{align}
f(x) & = (a+b)^2 \\
& = a^2+2ab+b^2 \\
\end{align}
<math>

\begin{align} f(x) & = (a+b)^2 \\ & = a^2+2ab+b^2 \\ \end{align} </math>

\begin{alignat}{2}
f(x) & = (a-b)^2 \\
& = a^2-2ab+b^2 \\
\end{alignat}
<math>

\begin{alignat}{2} f(x) & = (a-b)^2 \\ & = a^2-2ab+b^2 \\ \end{alignat} </math>

Multiline equations (must define number of columns used ({lcr}) (should not be used unless needed)
\begin{array}{lcl}
z & = & a \\
f(x,y,z) & = & x + y + z
\end{array}
<math>\begin{array}{lcl}

z & = & a \\ f(x,y,z) & = & x + y + z \end{array}</math>

Multiline equations (more)
\begin{array}{lcr}
z & = & a \\
f(x,y,z) & = & x + y + z
\end{array}
<math>\begin{array}{lcr}

z & = & a \\ f(x,y,z) & = & x + y + z \end{array}</math>

Breaking up a long expression so that it wraps when necessary, at the expense of destroying correct spacing
<nowiki>
<math>f(x) \,\!</math>
<math>= \sum_{n=0}^\infty a_n x^n </math>
<math>= a_0+a_1x+a_2x^2+\cdots</math>
</nowiki>
<math>f(x) \,\!</math><math>= \sum_{n=0}^\infty a_n x^n </math><math>= a_0 +a_1x+a_2x^2+\cdots</math>
Simultaneous equations
\begin{cases}
3x + 5y + z \\
7x - 2y + 4z \\
-6x + 3y + 2z
\end{cases}
<math>\begin{cases} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \end{cases}</math>
Arrays
\begin{array}{|c|c||c|} a & b & S \\
\hline
0&0&1\\
0&1&1\\
1&0&1\\
1&1&0\\
\end{array}
<math>

\begin{array}{|c|c||c|} a & b & S \\ \hline 0&0&1\\ 0&1&1\\ 1&0&1\\ 1&1&0\\ \end{array} </math>

Parenthesizing big expressions, brackets, bars

Feature Syntax How it looks rendered
Bad ( \frac{1}{2} ) <math>( \frac{1}{2} )</math>
Good \left ( \frac{1}{2} \right ) <math>\left ( \frac{1}{2} \right )</math>

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

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