{"id":3536,"library":"latex2sympy2-extended","title":"Latex2Sympy2 Extended","description":"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.","status":"active","version":"1.11.0","language":"en","source_language":"en","source_url":"https://github.com/OrangeX4/latex2sympy2.git","tags":["latex","sympy","math","parser","mathematics","calculus","linear algebra"],"install":[{"cmd":"pip install latex2sympy2-extended","lang":"bash","label":"Base Installation"},{"cmd":"pip install latex2sympy2_extended[antlr4_13_2]","lang":"bash","label":"Installation with specific ANTLR4 runtime"}],"dependencies":[{"reason":"Core dependency for symbolic mathematics.","package":"sympy","optional":false},{"reason":"Used for parsing LaTeX expressions, specific runtime versions (e.g., 4.9.3, 4.11.0, 4.13.2) can be specified during installation.","package":"antlr4-python3-runtime","optional":false}],"imports":[{"note":"Ensure you import from 'latex2sympy2_extended' and not the older 'latex2sympy2' or 'latex2sympy' packages.","wrong":"from latex2sympy2 import latex2sympy","symbol":"latex2sympy","correct":"from latex2sympy2_extended import latex2sympy"}],"quickstart":{"code":"from latex2sympy2_extended import latex2sympy\n\n# Define a LaTeX expression for a derivative\ntex_expression = r\"\\frac{d}{dx}(x^{2}+x)\"\n\n# Convert the LaTeX expression to a SymPy expression\nsympy_expression = latex2sympy(tex_expression)\n\nprint(sympy_expression)\n# Expected output: Derivative(x**2 + x, x)\n","lang":"python","description":"This quickstart demonstrates how to import the `latex2sympy` function and use it to convert a common LaTeX derivative expression into its SymPy equivalent."},"warnings":[{"fix":"Use Python 3.12 or an earlier version until compatibility is officially added.","message":"The library is not compatible with Python 3.13 due to the removal of 'typing.io'. It requires Python 3.12 or below.","severity":"breaking","affected_versions":"All versions with Python 3.13+"},{"fix":"Remove direct calls to `math_normalization.equations` and rely on the parser's built-in handling.","message":"The `latex2sympy2_extended.math_normalization.equations` module/functionality is deprecated as its handling is now integrated directly into the parser.","severity":"deprecated","affected_versions":"Versions 1.0.9 and later (as reported in Feb 2025)"},{"fix":"Be aware of this limitation and verify results for complex linear algebra operations.","message":"When converting certain linear algebra expressions (e.g., determinants, transposed matrices, elementary transformations), the conversion process may involve irreversible calculations, meaning the resulting SymPy expression might not be algebraically identical to the original if interpreted purely symbolically.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure that comma-separated numbers are used as standalone values or reformatted before passing to the parser if they are part of a larger expression.","message":"Comma-separated numbers are only supported in standalone forms (e.g., '1,233') and not within expressions (e.g., '1,233x').","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}