Skip to main content

Provides plugin to render formulae in django CMS

Project description

djangocms-katex

PyPI version Python version Django version django CMS version

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.

Example screenshot

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


Download files

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

Source Distribution

djangocms_katex-1.0.1.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djangocms_katex-1.0.1-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file djangocms_katex-1.0.1.tar.gz.

File metadata

  • Download URL: djangocms_katex-1.0.1.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for djangocms_katex-1.0.1.tar.gz
Algorithm Hash digest
SHA256 972ab4e88f1ae1467b45c153e552a1a90853afd8739011ff39da814220913ae7
MD5 b7b40cffe2404a0d36add953d7b9ee5f
BLAKE2b-256 8774f1f4639945ede83a653fb1f80450812c811846f27de99d853d81e7702ca0

See more details on using hashes here.

File details

Details for the file djangocms_katex-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for djangocms_katex-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c4cf9183f8b8479bc4bc82a4e208d1db7d088fcacc87a11dc81f57fa70e67d6
MD5 299347a698f49de5936338c76cfc2f8b
BLAKE2b-256 ae7bf42e565c2cff17a324bff2e6f4e607a7243d2903875548cf7e14dd9997c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page