Skip to main content

A Sphinx extension for rendering math on HTML pages.

Project description

The extension uses KaTeX for rendering of math in HTML pages. Itis designed as a replacement for mathjax which is slower in rednering, but comes as a build in extension with sphinx sphinx.ext.mathjax.

Usage

Installation:

pip install sphinxcontrib-katex

In your sphinx project, add the extension with:

extensions = [
    'sphinxcontrib.katex',
    ]

If you would like to add some LaTeX macros (\def) you can use the katex_macros config setting, for example:

katex_macros = r'''
    "\\i": "\\mathrm{i}",
    "\\e": "\\mathrm{e}^{#1}",
    "\\w": "\\omega",
    "\\vec": "\\mathbf{#1}",
    "\\x": "\\vec{x}",
    "\\d": "\\operatorname{d}\\!{}",
    "\\dirac": "\\operatorname{\\delta}\\left(#1\\right)",
    "\\scalarprod": "\\left\\langle#1,#2\\right\\rangle",
    '''

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

sphinxcontrib-katex-0.1.4.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

sphinxcontrib_katex-0.1.4-py2.py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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