Latex2Sympy2 Extended

1.11.0 · active · verified Sat Apr 11

latex2sympy2-extended parses LaTeX math expressions and converts them into equivalent SymPy forms. It supports a wide range of mathematical constructs including arithmetic, common functions, calculus, and linear algebra. The current version is 1.11.0, with a release cadence reflecting active development and maintenance.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import the `latex2sympy` function and use it to convert a common LaTeX derivative expression into its SymPy equivalent.

from latex2sympy2_extended import latex2sympy

# Define a LaTeX expression for a derivative
tex_expression = r"\frac{d}{dx}(x^{2}+x)"

# Convert the LaTeX expression to a SymPy expression
sympy_expression = latex2sympy(tex_expression)

print(sympy_expression)
# Expected output: Derivative(x**2 + x, x)

view raw JSON →