All Projects → mitya57 → python-markdown-math

mitya57 / python-markdown-math

Licence: BSD-3-Clause license
Math extension for Python-Markdown

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to python-markdown-math

Jekyll Spaceship
🚀 A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, mermaid, emoji, video, audio, youtube, vimeo, dailymotion, soundcloud, spotify, etc.
Stars: ✭ 196 (+100%)
Mutual labels:  math, mathjax
Texme
Self-rendering Markdown + LaTeX documents
Stars: ✭ 1,970 (+1910.2%)
Mutual labels:  math, mathjax
hexo-filter-mathjax
💯 Server side MathJax renderer plugin for Hexo.
Stars: ✭ 76 (-22.45%)
Mutual labels:  math, mathjax
Rich Text Editor
Math editor (http://digabi.github.io/rich-text-editor/)
Stars: ✭ 45 (-54.08%)
Mutual labels:  math, mathjax
react-native-math-view
Math view for react native! No WebView!
Stars: ✭ 49 (-50%)
Mutual labels:  math, mathjax
mathjax-node-cli
CLI tools for mathjax-node
Stars: ✭ 27 (-72.45%)
Mutual labels:  math, mathjax
arabic-mathjax
Beautiful Arabic Math on all browsers. An extension for MathJax v2.
Stars: ✭ 12 (-87.76%)
Mutual labels:  math, mathjax
BUPT-ICS-Courseware
北京邮电大学 数学系 信息与计算科学专业 课件
Stars: ✭ 76 (-22.45%)
Mutual labels:  math
finmath
The collections of simple, weighted, exponential, smoothed moving averages.
Stars: ✭ 49 (-50%)
Mutual labels:  math
my-math-notes
All of my math stuff from grad school.
Stars: ✭ 41 (-58.16%)
Mutual labels:  math
FixedPoint-Sharp
Fixed point math with 48.16 precision (based on lib by https://github.com/fholm)
Stars: ✭ 114 (+16.33%)
Mutual labels:  math
autoscheduler
Staffjoy Suite (V1) Deprecated Microservice - Original autoscheduling algorithm, which combines shift creation and assignment. No longer compatible with open-source suite.
Stars: ✭ 68 (-30.61%)
Mutual labels:  math
spatialmath-matlab
Create, manipulate and convert representations of position and orientation in 2D or 3D using Python
Stars: ✭ 142 (+44.9%)
Mutual labels:  math
rclc
Mathematical expression calculator with big integers, floats, common fractions, and complex numbers support
Stars: ✭ 24 (-75.51%)
Mutual labels:  math
hfmath
Render LaTeX math with Hershey Fonts
Stars: ✭ 76 (-22.45%)
Mutual labels:  math
vector2d
2D Vector Library. Operates using Objects, Array or Float32Array types to allow flexible performance.
Stars: ✭ 28 (-71.43%)
Mutual labels:  math
SWADroid
Android client for e-learning platform SWAD (http://openswad.org/).
Stars: ✭ 21 (-78.57%)
Mutual labels:  mathjax
autodiff
A .NET library that provides fast, accurate and automatic differentiation (computes derivative / gradient) of mathematical functions.
Stars: ✭ 69 (-29.59%)
Mutual labels:  math
yk-liu.github.io
Pointing to the Moon, my personal website.
Stars: ✭ 82 (-16.33%)
Mutual labels:  mathjax
Angles.js
Angles.js is a collection of functions to work with angles
Stars: ✭ 16 (-83.67%)
Mutual labels:  math

Travis CI status

Math extension for Python-Markdown

This extension adds math formulas support to Python-Markdown.

Installation

Install from PyPI

$ pip install python-markdown-math

Install locally

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.

Usage

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

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js">
</script>

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

Example of configuration for MathJax 2.x:

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

If you want to use MathJax 3.x, you need to teach it to understand 2.x-style <script> tags. See the upgrading documentation on how to do it. Alternatively, you may use the Arithmatex extension which has a generic output mode, that does not require such special configuration.

To pass the extension to Python-Markdown, use mdx_math as extension name. For example:

>>> md = markdown.Markdown(extensions=['mdx_math'])
>>> md.convert('$$e^x$$')
'<p>\n<script type="math/tex; mode=display">e^x</script>\n</p>'

Usage from the command line:

$ echo "\(e^x\)" | python3 -m markdown -x mdx_math
<p>
<script type="math/tex">e^x</script>
</p>

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 want to use GitLab-style delimiters ($`...`$ for inline math, and a code block-like ```math...``` syntax for standalone), use use_gitlab_delimiters=True configuration option.

If you want to this extension to generate a preview node (which will be shown when MathJax has not yet processed the node, or when JavaScript is unavailable), use add_preview=True configuration option.

Notes

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

This extension also works with Katex. Use the following in your page <head>:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.css" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/katex/dist/contrib/mathtex-script-type.min.js" defer></script>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].