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'

Download files

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

Source Distribution

flatlatex-0.10.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flatlatex-0.10-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file flatlatex-0.10.tar.gz.

File metadata

  • Download URL: flatlatex-0.10.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using 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+

File hashes

Hashes for flatlatex-0.10.tar.gz
Algorithm Hash digest
SHA256 dc87f8c438ada16e79f0771b64ca1b75289b3b965c633cf6e5adc7ae1553749a
MD5 c458a53ee26192880e6e57f027513862
BLAKE2b-256 04471bb4410c882e578c741dec121974b2997bad1dac0d9c7a2aaedf4e05aa31

See more details on using hashes here.

File details

Details for the file flatlatex-0.10-py3-none-any.whl.

File metadata

  • Download URL: flatlatex-0.10-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using 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+

File hashes

Hashes for flatlatex-0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 b6475f76714184ecf0fdb8ea890c238e60c6d24fe44ececf253cf2b69d49fe8c
MD5 bb4ab34c67b0786c8829e33bdd5fb9df
BLAKE2b-256 77d0bcfd37e447ee1bf0a763fd30b7642e2c7efcb4cbb6f001811a7f4d91fe96

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page