Skip to main content

A pandoc filter that renders math at build time using KaTeX.

Project description


A simple pandoc filter that uses KaTeX to render math equations at build time. It makes possible to display equations without any JavaScript execution in the browser.

Example usage

$ cat
# A title and whatnot.

This is inline $\log(\frac{1}{2})$ and this is display:


$ pandoc -s --filter pandoc-static-katex --to html5 --css -o math.html

Note that the --katex option of pandoc option doesn't add the styles since pandoc doesn't see any math element after the filter pass.


The script can be installed by pip:

python3 -m pip install pandoc_static_katex

The filter runs in Python 3.7+.

When the filter is run, KaTeX needs to be installed with nodejs; the command

npx katex

must work on the current path. The filter has been developed with version 0.10.2 of KaTeX.

Additionally, pandoc is needed for most usages.

Development mode

It requires flit to be installed from source in development mode.

flit install --symlink

Test script

If pandoc, katex and the filter have all been installed correctly, the command:


should produce rendered results in the test_results folder.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pandoc_static_katex, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size pandoc_static_katex-0.1.3.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View
Filename, size pandoc_static_katex-0.1.3-py3-none-any.whl (3.6 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page