# jemdoc+MathJax

jemdoc is a static site generator that is being widely used for creating simple academic websites like the one you are looking at now.

In addition to being lighter and easier to use than other static site generators, the ability to load LaTeX equations has been one of the reasons for jemdoc's popularity in creating adacemic websites. However, the original jemdoc loads LaTeX equations as PNG images, which can be pixelated on high-resolution displays or upon magnifying the webpage.

I have modified the original jemdoc code to support MathJax, which is “an open source JavaScript display engine for mathematics that works in all browsers” and has “high-quality typography” that is not pixelated. The modified code is called jemdoc+MathJax. The equations in this website are all created by jemdoc+MathJax.

## System Requirements

• Python 2 or Python 3

(Many thanks to Ganesh Ajjanagadde, who made most of the changes for Python 3 compatibility.)

Press the “Download ZIP” button in the right panel of jemdoc+MathJax's GitHub page.

## Examples

Here are LaTeX equation rendering examples taken from the MathJax samples page, demonstrating the perfect support of MathJax in jemdoc+MathJax.

$$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}\label{eq:lorentz}$$$

• Cauchy's Integral Formula

$$$f(a) = \frac{1}{2\pi i} \oint_\gamma \frac{f(z)}{z-a} dz$$$

• Angle Addition Formula for Cosines

$$$\cos(\theta + \varphi) = \cos\theta \cos\varphi - \sin\theta \sin\varphi$$$

• Gauss’ Divergence Theorem

$$$\int_D (\nabla \cdot \mathbf{F}) \, dV = \int_{\partial D} \mathbf{F} \cdot \mathbf{n} \, dS$$$

• Curl of a Vector Field

$$$\nabla \times \mathbf{F} = \left(\frac{\partial F_z}{\partial y} - \frac{\partial F_y}{\partial z}\right) \mathbf{\hat{i}} + \left(\frac{\partial F_x}{\partial z} - \frac{\partial F_z}{\partial x}\right) \mathbf{\hat{j}} + \left(\frac{\partial F_y}{\partial x} - \frac{\partial F_x}{\partial y}\right) \mathbf{\hat{k}}$$$

• Standard Deviation

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

• Definition of Christoffel Symbols

$$$(\nabla_X Y)^k = X^i (\nabla_i Y)^k = X^i \left(\frac{\partial Y^k}{\partial x^i} + \Gamma_{im}^k Y^m \right)$$$

Note that the usual tasks you perform on equations in LaTeX, such as automatic equation numbering and hyperlinking, are all supported in jemdoc+MathJax, as can be seen in the hyperlinked equation number in “Eq. $$\eqref{eq:lorentz}$$.”

You can see the LaTeX codes for the above equations by right-clicking the individual equations and selecting “Show Math As > TeX Commands.”

## How to Use

Once you download jemdoc+MathJax, you can install and use it like the original jemdoc. See the jemdoc user guide, especially the example page.

The additional features introduced in jemdoc+MathJax on top of the original jemdoc are as follows:

• MathJax support

• Underscore

• Link opening in the current web broswer tab (like this) or in a new tab (like this)

• Works on both Python 2 and 3

The usage of these new features can be found in the example/ directory in the downloaded jemdoc+MathJax package.

## jemdoc+MathJax in Action

Here are a few websites found on Google that show the actual usage of jemdoc+MathJax: