--- id: latex2sympy2-extended version: "1.11.0" license: MIT license_treatment: permissive maintenance: aging --- # latex2sympy2-extended — Convert LaTeX math to SymPy expressions License: permissive · Maintenance: aging · Downloads: 3.4M/mo ## What it is and what it does latex2sympy2_extended is a LaTeX-to-SymPy parser that reads mathematical notation in LaTeX format and produces equivalent SymPy symbolic expressions. It uses ANTLR 4.13.1 to generate its parser and handles a broad range of mathematical constructs: basic arithmetic and functions, calculus operations like derivatives and integrals, linear algebra including matrices and determinants, and set operations. The package is adapted from an earlier latex2sympy project and supports multiple ANTLR runtime versions. The typical workflow is to pass a LaTeX string to the main `latex2sympy()` function, which returns a SymPy expression you can then manipulate, evaluate, or further process in Python. It handles subscripts, Greek letters, common mathematical functions, and complex expressions with nested operations. One important caveat: operations on determinants, transposed matrices, and elementary row/column transformations perform actual symbolic computation and are not reversible—the result is simplified rather than left as a structural representation. Use it for: - Convert handwritten or scanned LaTeX math formulas into SymPy for symbolic computation and manipulation. - Parse mathematical expressions from documents or user input to enable programmatic solving and evaluation. - Automate derivation and integration workflows by converting LaTeX calculus notation to SymPy Derivative and Integral objects. - Transform matrix notation from LaTeX into SymPy Matrix objects for linear algebra operations. - Build educational tools or math tutoring systems that accept LaTeX input and perform symbolic analysis. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses LaTeX math expressions and converts them to SymPy symbolic form, supporting arithmetic, functions, calculus, linear algebra, and set operations. Yes, if you need to parse LaTeX math into SymPy. The package has low install friction, permissive licensing, no known vulnerabilities, and solid popularity (top 5000). The aging maintenance status (216 days since last release) is a minor concern for a parser—grammar-based tools are relatively stable—but verify that the ANTLR runtime version you choose aligns with your environment. Suitable for production use in math-heavy applications. ## Install pip install latex2sympy2-extended uv add latex2sympy2-extended poetry add latex2sympy2-extended ## Installing latex2sympy2-extended Before you install: Low install friction with only two runtime dependencies (sympy and antlr4-python3-runtime). Package is aging—last release was 216 days ago—so expect slower response to issues, though no active maintenance problems are evident. License in practice: MIT license is permissive, allowing use in commercial and proprietary projects with minimal restrictions. Quickstart: pip install latex2sympy2-extended from latex2sympy2_extended import latex2sympy tex = r"\frac{d}{dx}(x^{2}+x)" result = latex2sympy(tex) # => "Derivative(x**2 + x, x)" Requires Python 3.10 or later. Verify before relying: - Whether determinant, transpose, and elementary transformation calculations are truly irreversible in all use cases or only under specific conditions. - Performance characteristics with large or deeply nested LaTeX expressions. - Completeness of support for less common LaTeX math environments beyond those documented in examples. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 3.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags latex to sympy conversion, parse latex math expressions, latex equation parser, convert latex to python, symbolic math from latex, latex derivative integration, matrix latex parser, latex-parsing, symbolic-math, math-conversion [View on SkillFed](https://skillfed.io/packages/latex2sympy2-extended) · [View on PyPI](https://pypi.org/project/latex2sympy2-extended/)