sphinx-math-dollar
Sphinx extension to let you write LaTeX math using $$
What it is and what it does
sphinx-math-dollar is a Sphinx extension that translates dollar-sign math notation (familiar from LaTeX and Markdown) into Sphinx's native math directives. It lets you write inline math as $expression$ and display math as $$expression$$, which the extension parses and converts for rendering via MathJax or similar backends. This is useful if you prefer LaTeX-style syntax over Sphinx's :math: and .. math:: directives, or if you're migrating documentation from other systems that use dollar signs.
The extension uses a blacklist to avoid parsing dollar signs in code blocks, literals, and other contexts where they shouldn't be interpreted as math. It integrates with sphinx.ext.autodoc to handle math in docstrings. Configuration is minimal—add it to your extensions list and optionally configure MathJax to prevent conflicts. Known limitations include issues with absolute-value bars (which Sphinx may parse as inline substitutions) and a need for careful spacing or braces in certain edge cases.
Use it for:
- Migrating Markdown or LaTeX documentation to Sphinx RST while keeping familiar dollar-sign math syntax
- Writing scientific or mathematical documentation where dollar signs feel more natural than :math: directives
- Documenting Python packages with heavy mathematical content in docstrings via autodoc
- Reducing friction when teams transition from other documentation systems to Sphinx
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Sphinx extension that lets you write LaTeX math in reStructuredText using dollar-sign syntax ($ and $$) instead of Sphinx's native :math: directive.
Yes, if you are already using Sphinx and prefer dollar-sign math syntax. Install friction is minimal, the license is permissive, and there are no known security issues. Maintenance is aging but the repository is active. Be aware of the absolute-value workaround and test your math notation before committing to it in a large documentation project.
Install
sphinx-math-dollar on PyPI
pip
pip install sphinx-math-dollaruv
uv add sphinx-math-dollarpoetry
poetry add sphinx-math-dollarInstalling sphinx-math-dollar
Before you install
Low friction: pure Python wheel with a single runtime dependency on sphinx. Last release 190 days ago; repository is active and not archived, though maintenance pace suggests aging status.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install sphinx-math-dollar
In conf.py:
extensions = ['sphinx_math_dollar', 'sphinx.ext.mathjax']
In RST: $\int\sin(x)\,dx$ for inline math or $$\int\sin(x)\,dx$$ for display.
Requires Python >=3.11 and an existing Sphinx documentation project. MathJax configuration needed in conf.py to prevent parsing conflicts.
Verify before relying
- Whether absolute-value workarounds (spaces or braces) are acceptable for your math notation style
- Compatibility with Sphinx versions older than those tested in the classifiers
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — sphinx |
| Maintenance | aging — 190 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 76,915/month — #14,579 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sphinx_math_dollar-1.3-py3-none-any.whl
Tags
More Sphinx packages
Parses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
SphinxSphinx generates professional documentation…
permissive · top 1,000 on PyPI
sphinxcontrib-serializinghtmlA Sphinx extension that outputs documentation…
permissive · top 1,000 on PyPI
alabasterAlabaster is a clean, responsive Sphinx theme…
permissive · top 1,000 on PyPI
sphinxcontrib-htmlhelpA Sphinx extension that generates HTML help…
permissive · top 1,000 on PyPI
sphinxcontrib-qthelpA Sphinx extension that converts documentation…
permissive · top 1,000 on PyPI
sphinxcontrib-jsmathA Sphinx extension that renders mathematical…
permissive · top 1,000 on PyPI
sphinxcontrib-katexA Sphinx extension that renders mathematical…
permissive · top 15,000 on PyPI
sphinx-substitution-extensionsAdds substitution support to Sphinx directives,…
permissive · top 15,000 on PyPI
latex2sympy2-extendedParses LaTeX math expressions and converts them…
permissive · top 5,000 on PyPI
latex2sympy2Parses LaTeX math expressions and converts them…
permissive · top 15,000 on PyPI
python-markdown-mathAdds support for rendering mathematical…
permissive · top 15,000 on PyPI
sphinx_mdincludeSphinx extension that lets you include and…
permissive · top 15,000 on PyPI
simple-equA library of ready-to-use STEM equations…
permissive · top 15,000 on PyPI
myst-parserMyST-Parser extends CommonMark-compliant…
permissive · top 5,000 on PyPI
math-verifyEvaluates mathematical expressions from LLM…
permissive · top 5,000 on PyPI