Skip to content
This repository was archived by the owner on Aug 12, 2019. It is now read-only.

phresnel/forked.python-markdown-math

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Math extension for Python-Markdown

This extension adds math formulas support to Python-Markdown.

Installation

Simply copy math.py into markdown extensions path, for example /usr/lib/python3/dist-packages/markdown/extensions/.

Check Python-Markdown documentation for details on how to load extensions.

Usage

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>

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 single_dollar_delimiter=True in the extension configuration.

Notes

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

About

Math extension for Python-Markdown

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%