Date Tags Blog

This blog uses the static site generator Pelican. Here’s how you can set up Pelican to render LaTeX math equations.

In your Pelican content directory (mine is c:\blog\source), clone the Pelican plugins repository:

cd c:\blog\source
git submodule add plugins

Then modify your file to point at the path to the plugins and then which plugins you want to use:

PLUGINS = ['render_math']

render_math is a Pelican plugin for rendering LaTeX. That plugin extends Markdown so that anything in between $...$ is rendered as math. For example:

$x^2$ becomes \(x^2\)

$e=mc^2$ becomes \(e=mc^2\)

$\left| \nabla \phi \right| = 1$ becomes \(\left| \nabla \phi \right| = 1\)

You can also use $$...$$ to put the equation in a new paragraph, like this:

$$\dfrac {\partial \phi } {\partial t} + u \cdot \nabla \phi = 1$$


I don’t know LaTeX, but there are apps that will convert handwritten equations to LaTeX. I’ve been using an app called MyScript that works well. They have a web demo here:

With that, I can scribble some equations, and then cut and paste the LaTeX into Markdown, and easily create nice looking equations.