skillfed

sphinx-math-dollar

Sphinx extension to let you write LaTeX math using $$

sphinx-math-dollar v1.3 76.9K downloads/30d#14,579 on PyPI35
Permissive license MIT AGING released

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-dollar

uv

uv add sphinx-math-dollar

poetry

poetry add sphinx-math-dollar

Installing 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

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

sphinx latex math dollar signsrst math notation extensionsphinx math renderinglatex in documentationsphinx equation syntax
sphinx-extensionmath-renderingdocumentation

More Sphinx packages

docstring-parser

Parses Python docstrings in ReST, Google,…

permissive · top 1,000 on PyPI

Sphinx

Sphinx generates professional documentation…

permissive · top 1,000 on PyPI

sphinxcontrib-serializinghtml

A Sphinx extension that outputs documentation…

permissive · top 1,000 on PyPI

alabaster

Alabaster is a clean, responsive Sphinx theme…

permissive · top 1,000 on PyPI

sphinxcontrib-htmlhelp

A Sphinx extension that generates HTML help…

permissive · top 1,000 on PyPI

sphinxcontrib-qthelp

A Sphinx extension that converts documentation…

permissive · top 1,000 on PyPI

sphinxcontrib-jsmath

A Sphinx extension that renders mathematical…

permissive · top 1,000 on PyPI

sphinxcontrib-katex

A Sphinx extension that renders mathematical…

permissive · top 15,000 on PyPI

sphinx-substitution-extensions

Adds substitution support to Sphinx directives,…

permissive · top 15,000 on PyPI

latex2sympy2-extended

Parses LaTeX math expressions and converts them…

permissive · top 5,000 on PyPI

latex2sympy2

Parses LaTeX math expressions and converts them…

permissive · top 15,000 on PyPI

python-markdown-math

Adds support for rendering mathematical…

permissive · top 15,000 on PyPI

sphinx_mdinclude

Sphinx extension that lets you include and…

permissive · top 15,000 on PyPI

simple-equ

A library of ready-to-use STEM equations…

permissive · top 15,000 on PyPI

myst-parser

MyST-Parser extends CommonMark-compliant…

permissive · top 5,000 on PyPI

math-verify

Evaluates mathematical expressions from LLM…

permissive · top 5,000 on PyPI