Sympy generator from LaTeX expressions.
Project description
# latex2sympy
latex2sympy parses LaTeX math expressions and converts it into the
equivalent SymPy form.
## Installation
[ANTLR](http://www.antlr.org/) is used to generate the parser:
```
$ antlr4 PS.g4 -o gen
```
## Usage
In Python 2.7:
```python
from process_latex import process_sympy
process_sympy("\\frac{d}{dx} x^{2}")
# => "diff(x**(2), x)"
```
## Examples
|LaTeX|Image|Generated SymPy|
|-----|-----|---------------|
|`x^{3}`|| `x**3`|
|`\frac{d}{dx} |t|x`||`Derivative(x*Abs(t), x)`|
|`\sum_{i = 1}^{n} i`||`Sum(i, (i, 1, n))`|
|`\int_{a}^{b} \frac{dt}{t}`||`Integral(1/t, (t, a, b))`|
|`(2x^3 - x + z)|_{x=3}`||`z + 51`
## Contributing
Contributors are welcome! Feel free to open a pull request
or an issue.
latex2sympy parses LaTeX math expressions and converts it into the
equivalent SymPy form.
## Installation
[ANTLR](http://www.antlr.org/) is used to generate the parser:
```
$ antlr4 PS.g4 -o gen
```
## Usage
In Python 2.7:
```python
from process_latex import process_sympy
process_sympy("\\frac{d}{dx} x^{2}")
# => "diff(x**(2), x)"
```
## Examples
|LaTeX|Image|Generated SymPy|
|-----|-----|---------------|
|`x^{3}`|| `x**3`|
|`\frac{d}{dx} |t|x`||`Derivative(x*Abs(t), x)`|
|`\sum_{i = 1}^{n} i`||`Sum(i, (i, 1, n))`|
|`\int_{a}^{b} \frac{dt}{t}`||`Integral(1/t, (t, a, b))`|
|`(2x^3 - x + z)|_{x=3}`||`z + 51`
## Contributing
Contributors are welcome! Feel free to open a pull request
or an issue.
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
latex2sympy3-0.1.1.tar.gz
(6.1 kB
view details)
File details
Details for the file latex2sympy3-0.1.1.tar.gz
.
File metadata
- Download URL: latex2sympy3-0.1.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
71409084bdd36b500f29fda198e942c799b7e0b3fa50915accf3b5d0abdf5335
|
|
MD5 |
66ac1dd705081ecd52239f0b6fdddf8e
|
|
BLAKE2b-256 |
f828b5ae4512fa8febc1e5e0765af2553706def9854fe080b978f9d653057b89
|