10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-07-23 03:07:44 +02:00

Print error message when Latex cannot be parsed for state

This commit is contained in:
Mickaël Véril 2020-02-05 20:03:51 +01:00
parent 96428182c3
commit 9bc755fed5

View File

@ -44,7 +44,12 @@ class dataFileBase(object):
math=TexState.find("$")
lst=list(math.contents)
mystr=str(lst[0])
mathsoup=TexSoup(mystr)
mathsoup=None
try:
mathsoup=TexSoup(mystr)
except:
print(f"Error when parsing latex state: {mystr}")
exit(-1)
newCommand.runAll(mathsoup,commands)
st=str(mathsoup)
m=re.match(r"^\^(?P<multiplicity>\d)(?P<symm>[^\s\[(]*)\s*(?:\[(?:\\mathrm{)?(?P<special>\w)(?:})\])?\s*(:?\((?P<type>[^\)]*)\))?",st)