特别感谢:
Warp,为多AI代理编码而构建,支持macOS、Linux和Windows
英文 | 简体中文 | 繁體中文 | 日本語 | 한국어
PDFMathTranslate
保留布局的科学PDF文档翻译。
--mode precise)。(贡献者:https://github.com/reycn%EF%BC%89[!NOTE]
2.0版本已迁移至组织下的新仓库:https://github.com/PDFMathTranslate/PDFMathTranslate-next
2.0正式版已发布。
您可以通过以下任一演示体验本应用:
注意:演示的计算资源有限,请避免滥用。
3.2 本地安装
针对不同使用场景,我们提供多种本地使用方式:
3.2.1 Python:使用uv安装
3.2.2 Python:使用pip安装
3.3.3 Python:图形用户界面
更多详情请参见GUI文档。
3.2.4 应用程序:Windows系统
从https://github.com/Byaidu/PDFMathTranslate/releases%E4%B8%8B%E8%BD%BDpdf2zh-version-win64.zip
解压并双击pdf2zh.exe运行。
[!NOTE]
- 如果在Windows系统中下载后无法打开文件,请安装vc_redist.x64.exe后重试。
3.2.5 参考文献管理工具:Zotero插件
详情请参见https://github.com/guaguastandup/zotero-pdf2zh%E3%80%82
3.2.6 Docker:容器化部署
docker pull byaidu/pdf2zh
docker run -d -p 7860:7860 byaidu/pdf2zh
云服务Docker部署说明:
[!NOTE]
- 如果无法访问Docker Hub,请尝试https://github.com/Byaidu/PDFMathTranslate/pkgs/container/pdfmathtranslate%E4%B8%8A%E7%9A%84%E9%95%9C%E5%83%8F%EF%BC%9A
> docker pull ghcr.io/byaidu/pdfmathtranslate
> docker run -d -p 7860:7860 ghcr.io/byaidu/pdfmathtranslate
>
3.2.* 安装时网络问题的解决方案
特定地区用户在加载AI模型时可能遇到网络困难。当前程序依赖AI模型(wybxc/DocLayout-YOLO-DocStructBench-onnx),部分用户因网络问题无法下载该模型。
若遇到模型下载问题,可通过以下环境变量解决:
set HF_ENDPOINT=https://hf-mirror.com
PowerShell用户:
$env:HF_ENDPOINT = https://hf-mirror.com
如果上述解决方案无效或遇到其他问题,请参考https://github.com/Byaidu/PDFMathTranslate/wiki#-faq--%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%E3%80%82
在命令行执行翻译命令,将在当前工作目录生成翻译文档example-mono.pdf和双语文档example-dual.pdf。默认使用Google翻译服务。更多支持的翻译服务请参见https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#services%E3%80%82
下表列出所有高级选项供参考:
| 选项 | 功能 | 示例 |
|---|---|---|
| files | 本地文件 | pdf2zh ~/local.pdf |
| links | 在线文件 | pdf2zh http://arxiv.org/paper.pdf |
-i | 进入GUI | pdf2zh -i |
-p | https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#partial | pdf2zh example.pdf -p 1 |
-li | https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#languages | pdf2zh example.pdf -li en |
-lo | https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#languages | pdf2zh example.pdf -lo zh |
-s | https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#services | pdf2zh example.pdf -s deepl |
-t | https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#threads | pdf2zh example.pdf -t 1 |
-o | 输出目录 | pdf2zh example.pdf -o output |
-f, -c | https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#exceptions | pdf2zh example.pdf -f "(MS.*)" |
-cp | 兼容模式 | pdf2zh example.pdf --compatible |
--skip-subset-fonts | https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#font-subset | pdf2zh example.pdf --skip-subset-fonts |
--ignore-cache | https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#cache | pdf2zh example.pdf --ignore-cache |
--share | 公共链接 | pdf2zh -i --share |
--authorized | https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#auth | pdf2zh -i --authorized users.txt [auth.html] |
--prompt | https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#prompt | pdf2zh --prompt [prompt.txt] |
--onnx | [使用自定义DocLayout-YOLO ONNX模型] | pdf2zh --onnx [onnx/model/path] |
--serverport | [自定义WebUI端口] | pdf2zh --serverport 7860 |
--dir | [批量翻译] | pdf2zh --dir /path/to/translate/ |
--config | https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#cofig | pdf2zh --config /path/to/config/config.json |
--serverport | [自定义Gradio服务器端口] | pdf2zh --serverport 7860 |
--mode | 翻译模式:fast(默认,v1)或precise(v2,实验性,需pdf2zh_next子模块) | pdf2zh --mode precise example.pdf |
--babeldoc | 使用实验性后端https://funstory-ai.github.io/BabelDOC/%E8%BF%9B%E8%A1%8C%E7%BF%BB%E8%AF%91 | pdf2zh --babeldoc -s openai example.pdf |
--mcp | 启用MCP标准输入输出模式 | pdf2zh --mcp |
--sse | 启用MCP SSE模式 | pdf2zh --mcp --sse |
详细说明请参考高级用法文档。
4.2 下游开发 下游应用开发请参考API详情文档,包含以下内容:
4.3 两个主要分支的区别
https://github.com/Byaidu/PDFMathTranslate%EF%BC%9A%E5%BD%93%E5%89%8D%E9%A1%B9%E7%9B%AE%EF%BC%8C%E5%8E%9F%E5%A7%8B%E9%A1%B9%E7%9B%AE%EF%BC%8C%E7%94%A8%E4%BA%8E%E7%A8%B3%E5%AE%9A%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83%E3%80%82
https://github.com/PDFMathTranslate/PDFMathTranslate-next%EF%BC%9A%E5%8C%85%E5%90%ABWeb UI和额外功能的分支。该分支处理大量边缘情况,提升PDF兼容性,优化跨列和跨页语义一致性、动态缩放及动态缩放一致性等翻译质量改进。但该分支仅用于开发,不解决兼容性问题,也不面向社区贡献。
本工作已被《2025年自然语言处理经验方法会议论文集:系统演示》(EMNLP 2025)收录。
引用格式:
@inproceedings{ouyang-etal-2025-pdfmathtranslate,
title = "{PDFM}ath{T}ranslate: Scientific Document Translation Preserving Layouts",
author = "Ouyang, Rongxin and
Chu, Chang and
Xin, Zhikuang and
Ma, Xiangyao",
editor = {Habernal, Ivan and
Schulam, Peter and
Tiedemann, J{\"o}rg},
booktitle = "Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
month = nov,
year = "2025",
address = "Suzhou, China",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2025.emnlp-demos.71/",
pages = "918--924",
ISBN = "979-8-89176-334-0",
abstract = "Language barriers in scientific documents hinder the diffusion and development of science and technologies. However, prior efforts in translating such documents largely overlooked the information in layouts. To bridge the gap, we introduce PDFMathTranslate, the world{'}s first open-source software for translating scientific documents while preserving layouts. Leveraging the most recent advances in large language models and precise layout detection, we contribute to the community with key improvements in precision, flexibility, and efficiency. The work is open-sourced at https://github.com/byaidu/pdfmathtranslate with more than 222k downloads."
}
5.2 致谢
Immersive Translation每月为该项目的活跃贡献者提供Pro会员兑换码,详情参见:https://github.com/funstory-ai/BabelDOC/blob/main/docs/CONTRIBUTOR_REWARD.md
新后端:https://github.com/funstory-ai/BabelDOC
文档合并:https://github.com/pymupdf/PyMuPDF
文档解析:https://github.com/pdfminer/pdfminer.six
文档提取:https://github.com/opendatalab/MinerU
文档预览:https://github.com/freddyaboulton/gradio-pdf
多线程翻译:https://github.com/SUSYUSTC/MathTranslate
布局解析:https://github.com/opendatalab/DocLayout-YOLO
文档标准:https://zxyle.github.io/PDF-Explained/%E3%80%81PDF Cheat Sheets
多语言字体:https://github.com/satbyy/go-noto-universal
5.3 贡献者
贡献方法详情请参考https://github.com/Byaidu/PDFMathTranslate/wiki/Contribution-Guide---%E8%B4%A1%E7%8C%AE%E6%8C%87%E5%8D%97%E3%80%82
5.4 星标历史
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
不支持 push
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务