diff --git a/文本处理工具/剪贴板文本整理_mathpix.py b/文本处理工具/剪贴板文本整理_mathpix.py index bf056cb5..6f0105cb 100644 --- a/文本处理工具/剪贴板文本整理_mathpix.py +++ b/文本处理工具/剪贴板文本整理_mathpix.py @@ -292,6 +292,8 @@ for equation in raw_equations: #改单位 equation1 = re.sub(r"mathrm\{cm\}","text{cm}",equation1) equation1 = re.sub(r"mathrm\{km\}","text{km}",equation1) + #改cdots + equation1 = re.sub(r"ldots","cdots",equation1) modified_equations.append(equation1) @@ -362,6 +364,9 @@ modified_data = re.sub(r"([\u4e00-\u9fa5\$])[\s]*\n\\fourch",lambda x: x.group(1 #改圆弧 modified_data = re.sub(r"overparen",r"overset\\frown",modified_data) + #改连续的两个$$ +modified_data = re.sub(r"([\S])(\$\$)([\S])",lambda x: x.group(1)+x.group(3),modified_data) + setCopy(modified_data) with open("临时文件/outputfile.txt","w",encoding = "utf8") as f: