/wagtail-katex

Math typesetting for Wagtail CMS powered by KaTeX

Primary LanguagePythonApache License 2.0Apache-2.0

PyPI Package Version Python Version Wagtail Version License

Math typesetting for Wagtail CMS powered by KaTeX.

This package is forked from gatensj/wagtail-draftail-katex.
This package contains svg icon from Font Awesome, which is licensed under the CC BY 4.0 License.

KaTeX Editor Screenshot

Quick Start

Installation

Install the package using the following command:

pip install wagtail-katex

Add wagtailkatex to the INSTALLED_APPS section in your settings.py file:

INSTALLED_APPS = [
    ...
    "wagtailkatex",
    ...
]

Add RichTextField to your page model, then you should find the math typesetting icon in the toolbar of rich-text editor in Wagtail admin views.

Template rendering

Add required assets to your page template:

<link rel="stylesheet" href="{% static 'wagtailkatex/katex/katex.min.css' %}">
<script src="{% static 'wagtailkatex/katex/katex.min.js' %}"></script>
<script src="{% static 'wagtailkatex/wagtailkatex-template.js' %}"></script>

The page content contains KaTeX embed should render properly.