--- id: latex2sympy2 version: "1.9.1" license: MIT license_treatment: permissive maintenance: dormant --- # latex2sympy2 — Convert latex to sympy with ANTLR and support Matrix, Linear Algebra and CAS functions. License: permissive · Maintenance: dormant · Downloads: 538.6K/mo ## 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 above — verify before relying. Parses LaTeX math expressions and converts them to SymPy symbolic form, supporting arithmetic, functions, calculus, linear algebra, and matrix operations. 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 pip install latex2sympy2 uv add latex2sympy2 poetry add latex2sympy2 ## Installing latex2sympy2 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 538.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags latex to sympy conversion, parse latex math expressions, latex equation parser, symbolic math from latex, latex to python math, antlr latex parser, latex formula interpreter, latex-parsing, symbolic-math, antlr [View on SkillFed](https://skillfed.io/packages/latex2sympy2) · [View on PyPI](https://pypi.org/project/latex2sympy2/)