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$.
Here is a block math equation:
$$
\\frac{d}{dx} e^x = e^x
$$
And here is an alternative notation for a block math equation:
\[
x^n + y^n = z^n
\]
"""
# Convert the Markdown text to HTML with LaTeX2MathMLExtension
html = markdown.markdown(text, extensions=[
LaTeX2MathMLExtension()
])
print(html)
Metadata
Release files for L2M4M 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| l2m4m-1.0.4.tar.gz | 16.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| L2M4M-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.6 kB
Release files / l2m4m-1.0.4.tar.gz
| Download URL | l2m4m-1.0.4.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7fc451edb281604c1eb9d6fa626a8cce874e8a0d3641cca581c20b7544f51396
|
|
BLAKE2b-256 checksum How to use checksums |
1d712548c288ef1b27f3419285e45430b8f10b9be8f4c34b4d2ecec2d34baf42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Release files / L2M4M-1.0.4-py3-none-any.whl
| Download URL | L2M4M-1.0.4-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
766e232b28cfdc6397e9c47162a938dba26e5ab90bddec8d82eccb7896ab46d1
|
|
BLAKE2b-256 checksum How to use checksums |
f68a500639fe4b0b1dfc7775633b9173d96a474bbc0811578e916595c9b323f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|