Provides plugin to render formulae in django CMS
Project description
djangocms-katex
Provides a django CMS plugin to render formulae using KaTeX and its mhchem extension.
The plugin can display formulae either inline or in display mode. It is text-enabled, and you can add equations to rich text fields of djangocms-text-ckeditor.
The plugin form has a preview functionality that either shows the typed formula. Errors are shown in red.
Installation
For a manual install:
-
run
pip install djangocms-katex
-
add the following entries to your
INSTALLED_APPS
:"djangocms_katex",
-
run
python manage.py migrate
The Code plugin uses the ace code editor which is loaded from a CDN by default.
If you want the ace code editor to be served from static files, please use
djangocms-katex[static-ace]
instead of djangocms-katex
in your
requirements or with pip. Make the static files for the ace code editor available
to your project by adding djangocms_static_ace
to your project's
INSTALLED_APPS
.
djangocms-text-ckeditor's inline functionality might interfere with KaTeX's layout.
To ensure a great editing experience deactivate it if you use djangocms-katex by
removing TEXT_INLINE_EDITING = True
from your settings.py
file.
Usage
Once installed, a new puling ("KaTeX formula") is available and can be entered into any placeholder or within a text plugin.
djangocms-katex only loads required LaTeX JavaScript libraries on demand only. This might lead to formulae initially only shown in source code. To see the rendered formula in such a case, please reload the page which ensures that all required JavaScript is loaded.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for djangocms_katex-0.5.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 820ade59ee998f349880e02a0c88e9d3b2c056af8ece0bacbe1ad45f91328e4f |
|
MD5 | 6dfcb4902bfaf3c2b32a8b8994cbf966 |
|
BLAKE2b-256 | ef922cfeaa9e57a03bd98700d87bd9f93371aee37336baac52d809ea298050ef |