Registry / web-framework / sphinxcontrib-jsmath

sphinxcontrib-jsmath

JSON →
library1.0.1pypypi✓ verified 24d ago

Sphinxcontrib-jsmath is a Sphinx extension that enables rendering of display math in HTML output via JavaScript, utilizing the older jsMath library. It is often chosen for its smaller JavaScript package size compared to newer alternatives like MathJax. The current version is 1.0.1, last released in January 2019, but it continues to receive compatibility updates for newer Sphinx versions through various distribution packages.

pip install sphinxcontrib-jsmath
INSTALL
IMPORT
SIG · SPHINXCONTRIB-JSMA
S
sphinxcontrib-jsmath
web-frameworkpythonv1.0.1
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Extension Configuration
extensions = ['sphinxcontrib.jsmath']
extensions = ['sphinx.ext.jsmath']
The old 'sphinx.ext.jsmath' path was moved to 'sphinxcontrib.jsmath' in Sphinx 2.0 and the alias removed in Sphinx 4.0. Always use 'sphinxcontrib.jsmath' for modern Sphinx versions.

To enable sphinxcontrib-jsmath, add 'sphinxcontrib.jsmath' to the `extensions` list in your Sphinx project's `conf.py` file. Additionally, you must configure `jsmath_path` to point to the `jsMath/easy/load.js` file, which typically resides in your Sphinx project's `_static` directory after you've manually downloaded the jsMath library.

# conf.py # Add 'sphinxcontrib.jsmath' to the list of extensions extensions = [ 'sphinxcontrib.jsmath', # ... other extensions ] # Set the path to the jsMath library. # This example assumes jsMath is placed in your Sphinx project's _static directory, # e.g., <your_project_root>/_static/jsMath/easy/load.js # You need to download the jsMath library separately and place it there. # If jsMath is hosted externally, provide the full URL. jsmath_path = 'jsMath/easy/load.js'
Debug
Known issues
gotchaThe underlying jsMath library, on which this Sphinx extension relies, is no longer actively developed. This means new math rendering features or bug fixes specific to the JavaScript rendering engine are unlikely to be implemented.
fix
Be aware of the limitations of an older rendering engine. For more actively maintained math rendering, consider `sphinx.ext.mathjax`.
affects: All versions
breakingThe import path for this extension changed. For Sphinx versions 4.0 and newer, `sphinx.ext.jsmath` is no longer a valid entry for `extensions` in `conf.py`.
fix
Always use `'sphinxcontrib.jsmath'` in your `extensions` list in `conf.py`. This change was introduced in Sphinx 2.0, with the alias for the old path removed in 4.0.
affects: Sphinx >= 4.0
gotchaThe `jsmath_path` configuration variable has no default value. You must explicitly set this path in your `conf.py` to the location of the `jsMath/easy/load.js` file. Failure to do so will result in math not being rendered in your HTML output.
fix
Ensure `jsmath_path` is correctly configured in `conf.py` to point to the `jsMath/easy/load.js` file, typically within your `_static` directory or an external URL.
affects: All versions
gotchaDue to the `jsMath` library's age, it may have known bugs or suboptimal rendering with very old or specific browser versions (e.g., Opera 9.5, MSIE). While these browsers are largely obsolete, it highlights the legacy nature of the underlying technology.
fix
Modern browsers should render correctly, but be aware of potential issues with extremely old or niche browser environments.
affects: All versions
Upgrade
Version history
1.0.1latest on PyPI · released Jan 21, 2019
Audit
Dependencies
SphinxrequiredThis is a Sphinx extension and requires Sphinx to function.
Agent activity
8 hits · last 30 days
node
6
Resources
sphinxcontrib-jsmath — pip install sphinxcontrib-jsmath · libregistry