PDFMathTranslate
[EMNLP 2025 Demo] PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/MCP/Docker/Zotero
- 37.8k stars
- 3.4k forks
- 168 open issues
- Language: Python
- License: AGPL-3.0
- updated
Install
git clone https://github.com/PDFMathTranslate/PDFMathTranslate && cp PDFMathTranslate/*.md ~/.claude/agents/- Clone the repository and copy the agent .md definitions into ~/.claude/agents (or .claude/agents inside a project).
- Start a new Claude Code session to load the agents.
- Delegate work to them with the Task/Agent tool or by name.
Editor's note
PDFMathTranslate (also published as the `pdf2zh` Python package) translates full scientific PDF documents into a second language while preserving the original layout, including mathematical formulas, charts, tables of contents, and annotations. It produces bilingual output files that display both the source and translated text side by side. The tool connects to translation backends including Google Translate, DeepL, Ollama, OpenAI-compatible APIs, and MiniMax, and it exposes an MCP server interface that allows Claude Desktop and Claude Code agents to invoke translation directly as a subagent tool. Users can also interact through a CLI (`pdf2zh document.pdf`), a browser-based GUI launched via `pdf2zh -i`, or a Docker image. A Zotero plugin and Obsidian integration extend it to reference management and note-taking workflows. Researchers, academics, and multilingual teams working with scientific literature are the primary audience. A notable detail is the experimental `--mode precise` flag, which runs the v2.0 translation kernel in an isolated environment for higher-fidelity output.
Subagents overview
Special thanks to: Warp, built for coding with multiple AI agents Available for macOS, Linux and Windows
English | 简体中文 | 繁體中文 | 日本語 | 한국어
PDFMathTranslate
1. What does this do?
Scientific PDF document translation preserving layouts.
📊 Preserve formulas, charts, table of contents, and annotations.
🌐 Support multiple languages, and diverse translation services.
🤖 Provides commandline tool, interactive user interface, and Docker
2. Recent Updates
[October 3, 2026] Translated PDFs automatically add spaces between adjacent CJK and Latin letters, including accented letters, in normal and
--ultrafastmodes.[October 2, 2026] Added the
--ultrafastCLI mode for native-text PDFs. It usespdf-inspectortext positions for heuristic layout and skips ONNX layout and OCR. (by @reycn)[September 8, 2026] Experimental OCR support, with paragraph regrouping and adaptive typesetting. (by @reycn)
[March 23, 2026] Experimental support for v2.0 translation kernel using isolated environment (
--mode precise). (by @reycn)[March 22, 2026] Supporting MiniMax (PR by @octo-patch)
[March 22, 2026] Fixing OpenAI-related issues (PR by @samqin123)
[March 22, 2026] Fixing HTTP-related issues (PR by @soukouki)
[March 22, 2026] Faster model loading on mac and OONX platforms, GUI starting-up, version printing, and continuous integration.(by @reycn)
[May 9, 2025] pdf2zh 2.0 Preview Version #586: The Windows ZIP file and Docker image are now available.
Note
2.0 Moved to a new repository under the organization: PDFMathTranslate/PDFMathTranslate-next
Version 2.0 official release has been published.
3. Use 🌟 3.1 Online Service 🌟
You can try our application out using either of the following demos:
Public free service online without installation (recommended).
Immersive Translate - BabelDOC Free usage quota is available; please refer to the FAQ section on the page for details. (recommended)
Demo hosted on ModelScope without installation.
Note that the computing resources of the demo are limited, so please avoid abusing them.
3.2 Local Installation
For different use cases, we provide distinct methods to use our program:
3.2.1 Python: Install using uv
Python installed (3.11 <= version <= 3.12)
Install our package:
pip install uv uv tool install --python 3.12 pdf2zhExecute translation, files generated in current working directory:
pdf2zh document.pdf
3.2.2 Python: Install using pip
Python installed (3.11 <= version <= 3.12)
Install our package:
pip install pdf2zhExecute translation, files generated in current working directory:
pdf2zh document.pdf
3.3.3 Python: Graphic user interface
Python installed (3.11 <= version <= 3.12)
Install our package:
pip install pdf2zhStart using in browser:
pdf2zh -iIf your browser has not been started automatically, goto
http://localhost:7860/
See documentation for GUI for more details.
3.2.4 Application: On Windows
Download pdf2zh-version-win64.zip from release page
Unzip and double-click
pdf2zh.exeto run.
Tip
If you're using Windows and cannot open the file after downloading, please install vc_redist.x64.exe and try again.
3.2.5 Reference manager: Zotero Plugin
See Zotero PDF2zh for more details.
3.2.6 Docker: Containerized Deployment
Pull and run:
docker pull byaidu/pdf2zh docker run -d -p 7860:7860 byaidu/pdf2zhOpen in browser:
http://localhost:7860/
For docker deployment on cloud service:
Tip
If you cannot access Docker Hub, please try the image on GitHub Container Registry.
docker pull ghcr.io/byaidu/pdfmathtranslate docker run -d -p 7860:7860 ghcr.io/byaidu/pdfmathtranslate
3.2.* Solutions for network issues in installation
Users in specific regions may encounter network difficulties when loading the AI model. The current program relies on the AI model (wybxc/DocLayout-YOLO-DocStructBench-onnx), and some users are unable to download it due to these network issues.
To address issues with downloading this model, use the following environment variable as a workaround:
set HF_ENDPOINT=https://hf-mirror.comFor PowerShell user:
$env:HF_ENDPOINT = https://hf-mirror.comIf the solution does not work to you / you encountered other issues, please refer to Frequently Asked Questions.
4. Technical Details
Experimental automatic OCR (fast mode)
Fast mode automatically runs local OCR on selected image-only pages before
translation. Native text, existing OCR layers, and blank pages are skipped;
the original pages in dual output remain unchanged. Install with
pip install 'pdf2zh[ocr]' (or pip install -e '.[ocr]' from this checkout).
The first scanned page downloads the requested language data from Tesseract's
tessdata_fast 4.1.0 release into ~/.cache/pdf2zh/tessdata/4.1.0; subsequent
What people ask about PDFMathTranslate
What is PDFMathTranslate/PDFMathTranslate?
PDFMathTranslate/PDFMathTranslate is subagents for the Claude AI ecosystem. [EMNLP 2025 Demo] PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/MCP/Docker/Zotero It has 37.8k GitHub stars and its last recorded update is dated 2026-10-23.
How do I install PDFMathTranslate?
You can install PDFMathTranslate by cloning the repository (https://github.com/PDFMathTranslate/PDFMathTranslate) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is PDFMathTranslate/PDFMathTranslate safe to use?
Our security agent has analyzed PDFMathTranslate/PDFMathTranslate and assigned a Trust Score of 100/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.
Who maintains PDFMathTranslate/PDFMathTranslate?
PDFMathTranslate/PDFMathTranslate is maintained by PDFMathTranslate. The last recorded GitHub activity is dated 2026-10-23, with 168 open issues.
Are there alternatives to PDFMathTranslate?
Yes. On ClaudeWave you can browse similar subagents at /categories/agents, sorted by popularity or recent activity.
Maintain this repo? Show its Trust Score in your README
The badge shows this repository's current Trust Score and verdict, and links back to this page. It follows the catalogue data: nobody can buy or edit the score it displays.
[](https://claudewave.com/en/repo/pdfmathtranslate-pdfmathtranslate)<a href="https://claudewave.com/en/repo/pdfmathtranslate-pdfmathtranslate"><img src="https://claudewave.com/api/badge/pdfmathtranslate-pdfmathtranslate" alt="ClaudeWave Trust Score for PDFMathTranslate/PDFMathTranslate" width="320" height="64"></a>