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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mdtex2html-0.9.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 101ab2a75caa25eff40db3bdd8e37e7538667165986b994af7367d1de227983c |
|
MD5 | 758cccb685a0b5bfbcc94b5c62d02787 |
|
BLAKE2b-256 | 229e0bfbb40ea9317227dd966209244f4cbd489f9e28276183b26386f35813aa |