Latex2sympy
Parse LaTeX math expressions
Install / Use
/learn @augustt198/Latex2sympyREADME
latex2sympy
latex2sympy parses LaTeX math expressions and converts it into the equivalent SymPy form.
Installation
ANTLR is used to generate the parser:
$ antlr4 PS.g4 -o gen
Usage
In Python 2.7:
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.
Related Skills
node-connect
336.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
336.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
82.9kCommit, push, and open a PR
