from latex2sympy2 import latex2sympy latexstr = '(-\infty ,3) \cup…
- User
from latex2sympy2 import latex2sympy latex_str = '(-\infty ,3) \cup (\frac{1+\sqrt2}{2},\infty)' latex2sympy(latex_str) During handling of the above exception, another exception occurred:
LexerNoViableAltException Traceback (most recent call last) LexerNoViableAltException: LexerNoViableAltException('')
During handling of the above exception, another exception occurred:
Exception Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/latex2sympy2.py in syntaxError(self, recog, symbol, line, col, msg, e) 139 else: 140 err = fmt % ("I don't understand this", self.src, marker) --> 141 raise Exception(err) 142 143
Exception: I don't understand this (-\infty ,3) \cup (rac{1+\sqrt2}{2},\infty)
- Assistant
The LaTeX string seems to be corrupted with some unusual characters that are causing the lexer to fail. Please ensure that the LaTeX string is correctly formatted and try again.