Math extension for Python-Markdown
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 4 commits ahead, 37 commits behind mitya57:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Math extension for Python-Markdown

This extension adds math formulas support to Python-Markdown (works with version 2.6 or newer).


Use build and install to build and install this extension, respectively.

The extension name is mdx_math, so you need to add that name to your list of Python-Markdown extensions. Check Python-Markdown documentation for details on how to load extensions.


To use this extension, you need to include MathJax library in HTML files, like:

<script type="text/javascript" src=""></script>

Also, you need to specify a configuration for MathJax. Please note that most of standard configuratons include tex2jax extension, which is not needed with this code.

Example of MathJax configuration:

<script type="text/x-mathjax-config">
  config: ["MMLorHTML.js"],
  jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
  extensions: ["MathMenu.js", "MathZoom.js"]

Math Delimiters

For inline math, use \(...\).

For standalone math, use $$...$$, \[...\] or \begin...\end.

The single-dollar delimiter ($...$) for inline math is disabled by default, but can be enabled by passing enable_dollar_delimiter=True in the extension configuration.


If you use ReText, this extension is not needed as it is included by default.