Skip to main content

library to convert Markdown with included LaTeX-Formulas to HTML with MathML

Project description

mdtex2html

python3-library to convert Markdown with included LaTeX-Formulas to HTML with MathML

What is mdtex2html

mdtex2html is a library to convert (Github-flavored) Markdown-Code with includes LaTex-formulas to HTML-Source. The Formulas are converted to MathML-Code.

An inline-formula can either start and end with $ or it can start with \( and end with \), according to valid LaTeX-Code. Block-formulas either start and end with $$ or start with \[ an end with \].

An example that mdtex2html will convert:

# Example-Title

TeX-Formula: $\sqrt2=x^2 \Rightarrow x=\sqrt{\sqrt{2}}$

- This
- is
    - a List

Delete this and write your own `mdTeX`!

How to use mdtex2html

install i.e. with

pip install mdtex2html

then in python import in your code with

from mdtex2html import mdTeX2html

and convert your mdTeX with

mdTeX2html.convert('- Hello ${\sqrt{World}}^2$!')

passing any mdTeX-Code to it.

Limitations

The Firefox browser will display the result smoothly, as well as Safari (according to user reports).

Just be aware, that the Cromium-engine still is not able to render MathML, but rumors say that in 2020 work has started again to make that happen, so maybe you want to check the status there.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdtex2html-0.9.2.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

mdtex2html-0.9.2-py3-none-any.whl (13.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page