A LaTeX math converter to unicode text
Project description
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'
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
flatlatex-0.6.tar.gz
(13.9 kB
view details)
Built Distribution
flatlatex-0.6-py3-none-any.whl
(21.0 kB
view details)
File details
Details for the file flatlatex-0.6.tar.gz
.
File metadata
- Download URL: flatlatex-0.6.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a29bfabf878b7d320de331a20bbb7f089c7c39d141269a48bd1fe75bd53dd9a |
|
MD5 | 3414b5e1f52c55fd0b66524e67bee00d |
|
BLAKE2b-256 | 6f0add32f95303c3882ef1bd98bab529917ee2a37be376840160c419ff4d8372 |
File details
Details for the file flatlatex-0.6-py3-none-any.whl
.
File metadata
- Download URL: flatlatex-0.6-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95e79e63a093588f249157fe5e6dd2e0e4131ddac38e99068e38ff3516fa76ea |
|
MD5 | 62446541db040a0ab38f7c07c3f05646 |
|
BLAKE2b-256 | fab8331a7976850f39d71dbc1549930736b089d4818784fccf0ac57acbf243f5 |