Latex PDF Translator
Project description
PDFMathTranslate
基于字体规则和深度学习的 Latex PDF 翻译及双语对照,保留公式和图表排版
安装
pip install pdf2zh
使用
命令行中执行翻译指令,在当前目录下生成中文文档 example-zh.pdf
以及双语文档 example-dual.pdf
翻译完整文档
pdf2zh example.pdf
翻译部分文档
pdf2zh example.pdf -p 1-3,5
使用正则表达式指定需要保留样式的公式字体和字符
注:从 \ufb00
开始是英文风格连字
pdf2zh BDA3.pdf -f ".*\+(CM[^RT].*|MS.*|XY.*|MT.*|BL.*|.*0700|.*0500|.*Italic)" -c "(\(|\||\)|\+|=|\d|[\u0080-\ufaff])"
致谢
文档合并:PyMuPDF
文档解析:pdfminer.six
多线程翻译:MathTranslate
排版解析:LayoutParser
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pdf2zh-1.2.3.tar.gz
(129.2 kB
view details)
Built Distribution
pdf2zh-1.2.3-py3-none-any.whl
(137.6 kB
view details)
File details
Details for the file pdf2zh-1.2.3.tar.gz
.
File metadata
- Download URL: pdf2zh-1.2.3.tar.gz
- Upload date:
- Size: 129.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b21356f8806fda4d7d3ba21a34cd6599514c29f7c11284d41ecc30e020e737c2 |
|
MD5 | 1cb87998ece6010400f2156f5942e6ba |
|
BLAKE2b-256 | 46160b696fb1d0fe718ad165bcf0e567dea3256536a5f627c4d16af7b83c7f8a |
File details
Details for the file pdf2zh-1.2.3-py3-none-any.whl
.
File metadata
- Download URL: pdf2zh-1.2.3-py3-none-any.whl
- Upload date:
- Size: 137.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63d1f7ea07f26ca3a7cab89adb42021239aed061d5ba4c983d219dddf64f28c5 |
|
MD5 | 694265a9f155d221cb5f88f2dfb3ac22 |
|
BLAKE2b-256 | 9ea60db37eaba315602b8206c68182dada2ed853ff4b99d23ba26b05ec80656f |