latex2sympy2
Convert latex to sympy with ANTLR and support Matrix, Linear Algebra and CAS functions.
Decision gist · record as of 2026-08-14
Yes, if you need LaTeX-to-SymPy conversion and can tolerate dormant maintenance. The package is stable, has no known vulnerabilities, and handles a comprehensive set of mathematical operations. However, be aware that the last release was in 2023 and there have been no recent commits, so bug fixes or updates for newer Python versions are unlikely. It is suitable for established use cases but not for projects requiring active upstream support.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with only two runtime dependencies (sympy and antlr4-python3-runtime).
- However, the package is dormant—last release was 2023-04-23 and no commits since 2024-08-05, so maintenance support is limited.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute this package freely as long as you include the license notice.
last release 2023-04-23 (1209 days) · last repo commit 2024-08-05 · 148 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 538,617 downloads/mo, #6,113 on PyPI
Alternatives
Verify before relying
from latex2sympy2 import latex2sympy, latex2latex
tex = r"\frac{d}{dx}(x^{2}+x)"
result = latex2sympy(tex)
# => "Derivative(x**2 + x, x)"
latex_result = latex2latex(tex)
# => "2 x + 1"- Whether determinant, transpose, and elementary transformation operations are suitable for production use given the documented irreversible calculations.
- Current compatibility with modern Python versions beyond those listed in classifiers (3.3–3.8).
- Whether the package handles edge cases and malformed LaTeX gracefully or raises exceptions.
What it is and what it does
latex2sympy2 is a LaTeX-to-SymPy converter that parses mathematical expressions written in LaTeX notation and translates them into SymPy's symbolic representation. It uses ANTLR to generate its parser and handles a broad range of mathematical constructs: basic arithmetic and functions, calculus operations (derivatives, integrals, limits), linear algebra (matrices, determinants, transposes, row/column operations), and special functions like trigonometric and logarithmic operations.
The package is designed for developers and educators who work with mathematical notation in LaTeX or Markdown and need to convert those expressions into executable symbolic math. It can both parse expressions into SymPy objects and convert them back to LaTeX form after calculation. The package maintains a variable store for tracking assigned values and supports complex number operations, making it useful for interactive math environments, VS Code extensions, and educational tools.
Use it for
- Convert LaTeX derivatives and integrals to SymPy for symbolic computation and simplification.
- Parse matrix notation and perform elementary row/column transformations programmatically.
- Build interactive math calculators or educational tools that accept LaTeX input from users.
- Evaluate mathematical expressions written in LaTeX notation with variable substitution.
- Generate simplified LaTeX output after SymPy performs algebraic operations on parsed expressions.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need LaTeX-to-SymPy conversion and can tolerate dormant maintenance.
The package is stable, has no known vulnerabilities, and handles a comprehensive set of mathematical operations. However, be aware that the last release was in 2023 and there have been no recent commits, so bug fixes or updates for newer Python versions are unlikely. It is suitable for established use cases but not for projects requiring active upstream support.
Install
latex2sympy2 on PyPI
Before you install
Low install friction with only two runtime dependencies (sympy and antlr4-python3-runtime). However, the package is dormant—last release was 2023-04-23 and no commits since 2024-08-05, so maintenance support is limited.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute this package freely as long as you include the license notice.
Quickstart
from latex2sympy2 import latex2sympy, latex2latex
tex = r"\frac{d}{dx}(x^{2}+x)"
result = latex2sympy(tex)
# => "Derivative(x**2 + x, x)"
latex_result = latex2latex(tex)
# => "2 x + 1"
Verify before relying
- Whether determinant, transpose, and elementary transformation operations are suitable for production use given the documented irreversible calculations.
- Current compatibility with modern Python versions beyond those listed in classifiers (3.3–3.8).
- Whether the package handles edge cases and malformed LaTeX gracefully or raises exceptions.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagessympyantlr4-python3-runtime |
| Maintenance | Dormant 1,209 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 538,617 / month, #6,113 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: EducationTopic :: Scientific/Engineering :: MathematicsTopic :: Software Development :: CompilersTopic :: Text Processing :: Markup :: LaTeXTopic :: Text Processing :: Markup :: Markdown |
Evidence: latex2sympy2-1.9.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “parse latex math expressions”
- latex2sympy2Parses LaTeX math expressions and converts them to SymPy symbolic…
- latex2sympy2-extendedParses LaTeX math expressions and converts them to SymPy symbolic…
- py-asciimathConverts between ASCIIMath, LaTeX, and MathML mathematical notation…
Give your agent the search over MCP, or paste the wish link into any chat.
More Mathematics packages
NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.
kiwisolver is a Python binding to a fast C++ implementation of the Cassowary constraint solver, enabling you to solve systems of linear constraints and inequalities.
Install it if you need to solve constraint systems; skip it if you only need simple linear algebra.
SymPy is a Python library for symbolic mathematics, performing algebraic manipulation, calculus, equation solving, and mathematical expression simplification without numerical approximation.
ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.
PyTorch provides GPU-accelerated tensor computation and automatic differentiation for building and training deep neural networks in Python.
onnxruntime loads and executes Open Neural Network Exchange (ONNX) models with a focus on inference performance across CPUs and accelerators.
Install it if you have ONNX models to run in production or development.
See also latex2sympy2-extended · math-verify · py-asciimath · pylatexenc · sphinx-math-dollar · sphinxcontrib-katex · pysr · latex2mathml · python-markdown-math