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.5.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

sphinxcontrib_katex-0.1.5-py2.py3-none-any.whl (7.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sphinxcontrib-katex-0.1.5.tar.gz.

File metadata

File hashes

Hashes for sphinxcontrib-katex-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a4fb8213fc1a98ff16508e8140cfe2305af1bb93154b0998ab6717c7e3c5628c
MD5 ae278243f7392c918e14461967aea4b7
BLAKE2b-256 e31727c223cc4d40d77f5c766751b9d9645d988c23c0fbbcf19265e45ee3b0a4

See more details on using hashes here.

File details

Details for the file sphinxcontrib_katex-0.1.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for sphinxcontrib_katex-0.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4bc57c8ffdf9394f211fc8dcdc719d14f38b98e9d60ae3a526439f4a22ad62f1
MD5 c6a132b47749ee9ba771f66876ec8fe9
BLAKE2b-256 b5f35d81be08411c2e788d49650cd3def7011a482f1440fb747133bd293c93a8

See more details on using hashes here.

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