From eb1018407fee6bed6cc155d5ae3610cf685ce1b6 Mon Sep 17 00:00:00 2001 From: WangWeiye Date: Wed, 7 Jun 2023 08:35:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E5=89=AA=E8=B4=B4=E6=9D=BFmathpix?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=A4=84=E7=90=86=E5=B7=A5=E5=85=B7=E4=B8=AD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4=E8=BF=9E=E7=BB=AD$?= =?UTF-8?q?=E7=AC=A6=E5=8F=B7=E5=8A=9F=E8=83=BD,=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2ldots=E4=B8=BAcdots=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 文本处理工具/剪贴板文本整理_mathpix.py | 5 +++++ 1 file changed, 5 insertions(+) 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: