Processing math: 100%

A second example with MathJax activated (and the paper theme)

To know how to include MathJax in a StrapDown-flavored HTML page, you can read this example 3. To discover an even nicer way to import MathJax, read the last example.

These examples are directly imported from the samples from the mathjax.org website.

The following equations are included in the HTML source code as pure LaTeX code.


The Lorenz Equations

{˙x=σ(yx)˙y=ρxyxz˙z=βz+xy

The previous equation corresponds to the following code, inserted verbatim in the Markdown part of this page (ie. after the opening xmp tag and before its closing):

$$\left\\\{\begin{aligned}
\dot{x} & = \sigma(y-x) \\\\
\dot{y} & = \rho x - y - xz \\\\
\dot{z} & = -\beta z + xy
\end{aligned}\right. $$

The Cauchy-Schwarz Inequality (in Rn)

(nk=1akbk)2(nk=1a2k)(nk=1b2k)

The previous equation corresponds to the following code, inserted verbatim in the Markdown part of this page:

$$ \left( \sum\_{k=1}^n a\_k b\_k \right)^2 \leq \left( \sum\_{k=1}^n a\_k^2 \right) \left( \sum\_{k=1}^n b\_k^2 \right) $$

A Cross Product Formula

V1×V2=|ijkXuYu0XvYv0|

The previous equation corresponds to the following code, inserted verbatim in the Markdown part of this page:

$$\mathbf{V}\_1 \times \mathbf{V}\_2 =  \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\\\
\frac{\partial X}{\partial u} &  \frac{\partial Y}{\partial u} & 0 \\\\
\frac{\partial X}{\partial v} &  \frac{\partial Y}{\partial v} & 0
\end{vmatrix}  $$

The probability of getting k heads when flipping n coins is

P(E)=(nk)pk(1p)nk

The previous equation corresponds to the following code, inserted verbatim in the Markdown part of this page:

$$P(E) = {n \choose k} p^k (1-p)^{n-k} $$

An Identity of Ramanujan (obviously)

1(ϕ5ϕ)e25π=1+e2π1+e4π1+e6π1+e8π1+

The previous equation corresponds to the following code, inserted verbatim in the Markdown part of this page:

$$ \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} =
1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}}
{1+\frac{e^{-8\pi}} {1+\ldots} } } } $$

A Rogers-Ramanujan Identity

1+q2(1q)+q6(1q)(1q2)+=j=01(1q5j+2)(1q5j+3),for |q|<1.

The previous equation corresponds to the following code, inserted verbatim in the Markdown part of this page:

$$  1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
\prod\_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
\quad\quad \text{for $|q|&lt;1$}. $$

Maxwell's Equations

{×B1cEt=4πcjE=4πρ×E+1cBt=0B=0

The previous equation corresponds to the following code, inserted verbatim in the Markdown part of this page:

$$  \left\\\{\begin{aligned}
    \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\\\
    \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\\\
    \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\\\
    \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}\right.
$$

As you can see, math environment (like aligned) are supported by MathJax, even with the default configuration and no external plugin.


Inline equations are also supported.

Finally, while display equations look good for a page of samples, the ability to mix math and text in a paragraph is also important. This expression 3x1+(1+x)2 is an example of an inline equation (inserted with the code $\sqrt{3x-1}+(1+x)^2$). As you see, MathJax equations can be used this way as well, without unduly disturbing the spacing between lines.

End of the examples

That's all for today!