Extends Markdown to convert LaTeX to MathML.
Project description
L2M4M
L2M4M (LaTeX2MathML4Markdown) is a Python package that extends the functionality of Markdown to support LaTeX math expressions by converting them to MathML, using Latex2MathML. This package is particularly useful for those who want to include mathematical notation in their Markdown documents without relying on external JavaScript libraries.
Installation
To install L2M4M, use pip:
pip install L2M4M
Usage
import markdown
from l2m4m import LaTeX2MathMLExtension
# Sample Markdown text with LaTeX
text = """
Here is an inline math equation: $E = mc^2$
And here is a block math equation:
$$
\\frac{d}{dx} e^x = e^x
$$
"""
# Convert the Markdown text to HTML with LaTeX2MathMLExtension
html = markdown.markdown(text, extensions=[
LaTeX2MathMLExtension()
])
print(html)
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
l2m4m-1.0.2.tar.gz
(16.2 kB
view hashes)
Built Distribution
L2M4M-1.0.2-py3-none-any.whl
(14.9 kB
view hashes)