From b099f0a70daf95e8167413fcecd55f0eadee1f25 Mon Sep 17 00:00:00 2001 From: Byaidu <909756245@qq.com> Date: Tue, 26 Nov 2024 01:47:59 +0800 Subject: [PATCH 1/2] fix: typo --- pdf2zh/converter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdf2zh/converter.py b/pdf2zh/converter.py index 69fd9d7..c5a5a83 100644 --- a/pdf2zh/converter.py +++ b/pdf2zh/converter.py @@ -528,10 +528,10 @@ def vflag(font, char): # 匹配公式(和角标)字体 pstk[-1][5] = child.font sstk[-1] += child.get_text() else: # 公式入栈 - if ( # 根据公式右侧的文字修正公式的纵向偏移 + if ( # 根据公式左侧的文字修正公式的纵向偏移 not vstk # 1. 当前字符是公式的第一个字符 and cls == xt_cls # 2. 当前字符与前一个字符属于同一段落 - and child.x0 > xt.x0 # 3. 当前字符在前一个字符右侧 + and child.x0 > xt.x0 # 3. 前一个字符在公式左侧 ): vfix = child.y0 - xt.y0 vstk.append(child) From 1eb6ac8f3ac995d187208dcd6f80173fa606131e Mon Sep 17 00:00:00 2001 From: Byaidu <909756245@qq.com> Date: Tue, 26 Nov 2024 02:32:07 +0800 Subject: [PATCH 2/2] doc: todo --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bcc9428..e719cc0 100644 --- a/README.md +++ b/README.md @@ -258,12 +258,14 @@ pdf2zh example.pdf -t 1