Extension:Math/MathJax testing

MathJax is a JavaScript display engine for mathematics. It's an alternative to PNG rendering for Wikimedia sites. MathJax is slower to render, but more scalable (infinite zoom) and manipulable than PNG.

MathJax is currently enabled on this wiki (mediawiki.org), but you have to explicitly enable it in your user preferences (under Appearance -> Math). Otherwise you'll still see the old-school PNG images.

How to test:
 * Enable MathJax
 * Put some formulas below or in your sandbox
 * Report issues on the talk page or report a bug against the "Math" extension (known issues)

Examples and tests
$${{\gamma}_{\text{S}}}={{\rho}_{\text{S}}}\cdot \text{g}\quad[\text{kN}/\text{m}^\text{3} ]$$

Following examples copied from English Wikipedia math help page.

Quadratic polynomial

 * $$ax^2 + bx + c = 0$$

$${{\gamma}_{\text{S}}}={{\rho}_{\text{S}}}\cdot \text{g}\quad[\text{kN}/\text{m}^\text{3}$$ $$ax^2 + bx + c = 0$$

Quadratic polynomial (force PNG rendering)

 * $$ax^2 + bx + c = 0\,\!$$

$$ax^2 + bx + c = 0\,\!$$

Quadratic formula

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

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

Tall parentheses and fractions

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

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


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

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


 * $$x=\frac{a \times b}{c}\text{full month's benefits}\times\frac{(\text{number of days in month}+1-\text{date of application})}{\text{number of days in month}} =\text{allotment}$$

Integrals

 * $$\int_a^x \!\!\!\int_a^s f(y)\,dy\,ds = \int_a^x f(y)(x-y)\,dy$$

$$\int_a^x \!\!\!\int_a^s f(y)\,dy\,ds = \int_a^x f(y)(x-y)\,dy$$

Summation

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

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


 * $$\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n}{3^m\left(m\,3^n+n\,3^m\right)}$$

$$\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n} {3^m\left(m\,3^n+n\,3^m\right)}$$

Differential equation

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

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

Complex numbers

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

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

Limits

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

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

Integral equation

 * $$\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$$ $$\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$$

Example

 * $$\phi_n(\kappa) = 0.033C_n^2\kappa^{-11/3},\quad \frac{1}{L_0}\ll\kappa\ll\frac{1}{l_0}$$

$$\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) = \begin{cases}1 & -1 \le x < 0 \\

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

Prefixed subscript

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

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

 * $$\frac{a}{b}\ \tfrac{a}{b}$$

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

Area of a quadrilateral

 * $$S=dD\,\sin\alpha\!$$

$$S=dD\,\sin\alpha\!$$

Volume of a sphere-stand

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

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

Multiple equations

 * $$\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) \end{align}$$ $$ {\begin{aligned}q_{1}&=\cos \left({\frac {\phi -\psi }{2 }} \right)\sin \left({\frac {\theta }{2 }} \right)\\q_{2}&=\sin \left({\frac {\phi -\psi }{2 }}\right)\sin \left({\frac {\theta }{2}} \right)\\q_{3}&=\sin \left({\frac {\phi +\psi }{2 }} \right)\cos \left({\frac {\theta  }{2 }} \right)\\q_{4}&=\cos \left({\frac {\phi +\psi }{2 }}\right)\cos \left({\frac {\theta }{2}} \right)\end{aligned }} $$


 * $$1 < 2 \& 3 > 4$$
 * $$\begin{align} 1 < 2 & 3 > 4 \end{align}$$

$${{\upgamma}_{\text{S}}}={{\uprho}_{\text{S}}}\cdot \text{g}\quad[\text{kN}/\text{m}^\text{3}$$

Equation references

 * $$\begin{equation}\label{eq1}

x = \sin(y) \end{equation}$$ The above has label $$\ref{eq1}$$ $$\begin{equation}\label{eq1} x = \sin(y) \end{equation}$$ The above has label $$\ref{eq1}$$

CJK

 * $$中文$$
 * $$\text{中文}$$
 * $$中\text{文}$$

Textstyles

 * $$\textbf{bold text}$$
 * $$\textit{itallic text}$$
 * $$\textrm{roman text}$$
 * $$\texttt{teletype text}$$ should render as $${\tt teletype\ text}$$
 * $$\textsf{sanserif text}$$ should render as $${\sf sanserif\  text}$$
 * $$\emph{emphasized text}$$

Also in Latex 2e
 * $$\textmd{midsize text}$$ should render as $${\md midsize\ text}$$
 * $$\textup{upper case text}$$ should render as $${\up upper\ case\ text}$$
 * $$\textsl{slanted text}$$ should render as $${\sl slanted\ text}$$
 * $$\textsc{small cap text}$$ should render as $${\sc small\ cap\ text}$$

Nesting
 * $$\textit{\textbf{Nested bold and itallic}}$$
 * $$\textbf{\textit{Nested itallic and bold}}$$
 * $$\textbf{\upgamma{Mathroman}}$$

Math font styles
 * $$\mathbf{bold\ text}$$
 * $$\mathit{itallic\ text}$$
 * $$\mathrm{roman\ text}$$
 * $$\mathtt{teletype\ text}$$
 * $$\mathsf{sanserif\ text}$$
 * $$\mathnormal{normal\ text}$$
 * $$\mathcal{CAL\ LETTERS}$$
 * $$\mathrm{\gamma}$$

Sizes
 * $$\tiny tiny$$
 * $$\scriptsize scriptsize$$
 * $$\footnotesize footnotesize$$
 * $$\small small$$
 * $$\normalsize normalsize$$
 * $$\large large$$
 * $$\Large Large$$
 * $$\LARGE LARGE$$
 * $$\huge huge$$
 * $$\Huge Huge$$