Skip to main content

Wagtail StreamField block for rendering mathematical equations

Project description

WagtailMath allows you to write equations in your Wagtail content using markup and render them beautifully.

WagtailMath provides a MathBlock so you can write equations in markup (TeX, MathML, ASCIIMath) and render them with MathJax. It features a live preview:

MathBlock in the Wagtail admin

MathBlock uses MathJax for rendering so there is very little to do on the front end. Simply include the MathJax JS and render the raw MathBlock content as you would for any other streamfield plain text block.

WagtailMath even includes a template tag to include the MathJax JS for you from a CDN. By default, MathJax is configured to accept all recognised markup (TeX, MathML, ASCIIMath) and renders them to HTML. To change the configuration, you can pass the desired config command to the templatetag. See for possible configurations.

For help on using the markup languages see the relevant MathJax documentation (e.g. and the markup language-specific documentation (e.g.


Install wagtailmath:

pip install wagtailmath

Add it to your INSTALLED_APPS:


Use MathBlock in your StreamField content:

from wagtailmath.blocks import MathBlock

class MyPage(Page):
    body = StreamField([
        ('heading', blocks.CharBlock(classname="full title")),
        ('paragraph', blocks.RichTextBlock()),
        ('equation', MathBlock())

Use the mathjax template tag in your front end template to load the MathJax library:

{% load wagtailmath %}

<script src="{% mathjax %}"></script>


1.2.0 (TBD)

  • Upgrade to newer version of Django + Wagtail

0.1.0 (2017-04-24)

  • First release on PyPI.

Project details

Download files

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

Source Distribution

wagtailmath-1.2.0.tar.gz (9.7 kB view hashes)

Uploaded source

Built Distribution

wagtailmath-1.2.0-py2.py3-none-any.whl (7.6 kB view hashes)

Uploaded py2 py3

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