[][Travis]
[Travis]: https://travis-ci.org/mitya57/python-markdown-math
This extension adds math formulas support to Python-Markdown.
pip install python-markdown-math
Use setup.py build and setup.py 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="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></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">
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
extensions: ["MathMenu.js", "MathZoom.js"]
});
</script>
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 want to render to span elements with inline math rather than script
elements, so as to improve fallback when JavaScript is disabled or unavailable,
use render_to_span=True.
If you use ReText, this extension is not needed as it is included by default.