Skip to main content

flatlatex is a basic converter from LaTeX math to human readable text math using unicode characters.

Basic example:

>>> import flatlatex
>>> c = flatlatex.converter()
>>> c.convert(
... (
...     r'\forall \eta>0\, \exists n\in\mathbb{N}\, \forall i>n\,'
...     r' |u_i-\mathcal{l}|<\eta'
... ))
'∀η>0 ∃n∈ℕ ∀i>n |uᵢ-𝓵|<η'

Commands can be added with LaTeX syntax:

>>> import flatlatex
>>> c = flatlatex.converter()
>>> c.add_newcommand(r'\newcommand\prob{\mathbb{P}}')
>>> c.add_newcommand(r'\newcommand\binom[2]{\frac{#2!}{#1!(#2-#1)!}}')
>>> c.convert(r'\prob(X=k)\,=\,\binom{k}{n}\times p^k(1-p)^{n-k}')
'ℙ(X=k) = (n!)/(k!(n-k)!)×pᵏ(1-p)ⁿ⁻ᵏ'

The behavior can be change:

>>> import flatlatex
>>> c = flatlatex.converter()
>>> c.convert(r'\frac{8}{9}')
'⁸⁄₉'
>>> c.allow_zw = False
>>> c.convert(r'\frac{8}{9}')
'8/9'

Metadata

Release files for flatlatex 0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flatlatex 0.12
File Size Uploaded Provenance Actions
flatlatex-0.12.tar.gz 15.1 kB Without provenance Details for flatlatex-0.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flatlatex 0.12
File Interpreter ABI Platform Actions
flatlatex-0.12-py3-none-any.whl Python 3 none any Details for flatlatex-0.12-py3-none-any.whl

Total release size: 37.9 kB

Release files / flatlatex-0.12.tar.gz

Download URL flatlatex-0.12.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a9633d827eb1b860274bfb8924664855d76eaa0c51131327ee9cad36c55a0ab6
BLAKE2b-256 checksum
How to use checksums
720855edefb0960adbd962a909997b1e2f1659fdf18f2acd3dc9554e28479146
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1+

Release files / flatlatex-0.12-py3-none-any.whl

Download URL flatlatex-0.12-py3-none-any.whl
Size 22.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f513ee1f8421222b59e078a58e2f9a3b2bd064ac106e550393b625f86f83f7f
BLAKE2b-256 checksum
How to use checksums
3c66d6ce9593d78b1b089b6fc516e7063bfe585d7778f48e95c8c22e2848548a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1+

Security for flatlatex 0.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page