/ReX

ReX - typesetting mathematics

Primary LanguageRust

ReX  

ReX logo

Typesetting Mathematics

Samples

You can try ReX live here! Simply type in a formula in the editor and click the display on the top to update the rendering.

Note: ReX rendered all of these examples in SVG, but due to limitations in SVG rendering on GitHub, we need to convert them to PNG. See the samples/ folder for the original SVG source.

The Quadratic Fromula

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

Example

Double angle formula for Sine

\sin(\theta + \phi) = \sin(\theta)\cos(\phi) + \sin(\phi)\cos(\theta)

Example

Divergence Theorem

\int_D (\nabla \cdot F)\,\mathrm{d}V = \int_{\partial D} F \cdot n\,\mathrm{d}S

Example

Standard Deviation

\sigma = \sqrt{ \frac{1}{N} \sum_{i=1}^N (x_i - \mu)^2 }

Example

Fourier Inverse

f(x) = \int_{-\infty}^{\infty} \hat f(\xi) e^{2\pi i \xi x}\,\mathrm{d}\xi

Example

Cauchy-Schwarz Inequality

\left\vert \sum_k a_kb_k \right\vert \leq \left(\sum_k a_k^2\right)^{\frac12}\left(\sum_k b_k^2\right)^{\frac12}

Example

Exponent

e = \lim_{n \to \infty} \left(1 + \frac{1}{n}\right)^n

Example

Ramanujan's Identity

\frac{1}{\pi} = \frac{2\sqrt{2}}{9801} \sum_{k=0}^\infty \frac{ (4k)! (1103+26390k) }{ (k!)^4 396^{4k} }

Example

A surprising identity

\int_{-\infty}^{\infty} \frac{\sin(x)}{x}\,\mathrm{d}x = \int_{-\infty}^{\infty}\frac{\sin^2(x)}{x^2}\,\mathrm{d}x

Example

Another gem from Ramanujan

\frac{1}{\left(\sqrt{\phi\sqrt5} - \phi\right) e^{\frac{2}{5}\pi}} = 1 + \frac{e^{-2\pi}}{1 + \frac{e^{-4\pi}}{1 + \frac{e^{-6\pi}}{1 + \frac{e^{-8\pi}}{1 + \cdots}}}}

Example

Another gem from Cauchy

f^{(n)}(z) = \frac{n!}{2\pi i} \oint \frac{f(\xi)}{(\xi - z)^{n+1}}\,\mathrm{d}\xi

Example

An unneccesary number of scripts

x^{x^{x^x_x}_{x^x_x}}_{x^{x^x_x}_{x^x_x}}

Example

Quartic Function

\mathop{\overbrace{c_4x^4 + c_3x^3 + c_2x^2 + c_1x + c_0}}\limits^{\gray{\mathrm{Quartic}}}

Example

Another fun identity

3^3 + 4^4 + 3^3 + 5^5 = 3435

Example

Install

First note that ReX is currently in heavy development and is not intended to be used in any way other than for testing and debugging. That being said, you can install ReX using a Rust compiler. Instructions are found here.

You can look at the examples in the tests/ folder to see ReX in action, or simply run

cargo run 'x = \frac{-b \pm \sqrt{b^2 - 4ac}{2a}'

for a standalone SVG. The file will be saved as "test.svg".

License

ReX is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See LICENSE-APACHE, and LICENSE-MIT for details.