refinemathpix中增加对langle和rangle前\left与\right的处理

This commit is contained in:
wangweiye7840 2024-02-04 16:22:48 +08:00
parent c23f40150a
commit 9e43fda52d
1 changed files with 1 additions and 0 deletions

View File

@ -1223,6 +1223,7 @@ def RefineMathpix(raw_string): # 进一步修改mathpix得到的字符串
string = re.sub(r"\\right([\.\)\]|])",lambda matchobj: "" if matchobj.group(1) == "." else matchobj.group(1),string) #删去括号前的\right标记\
string = re.sub(r"\\left\\\{","\\{",string) #删去大括号前的\left标记
string = re.sub(r"\\right\\\}","\\}",string) #删去大括号前的\right标记
string = string.replace("\\left\\langle","\\langle").replace("\\right\\rangle","\\rangle")
for s in puctuationsfulltosemi:
string = re.sub(s,puctuationsfulltosemi[s],string) #将部分全角标记替换为半角
for s in replacestrings: