Skip to main content
ClaudeWave
EN, English
PDFMathTranslate / Subagents

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

Terminal
git clone https://github.com/PDFMathTranslate/PDFMathTranslate && cp PDFMathTranslate/*.md ~/.claude/agents/
  1. Clone the repository and copy the agent .md definitions into ~/.claude/agents (or .claude/agents inside a project).
  2. Start a new Claude Code session to load the agents.
  3. 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.

README

Subagents overview

Full README on GitHub

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.

2. Recent Updates

  • [October 3, 2026] Translated PDFs automatically add spaces between adjacent CJK and Latin letters, including accented letters, in normal and --ultrafast modes.

  • [October 2, 2026] Added the --ultrafast CLI mode for native-text PDFs. It uses pdf-inspector text 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:

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

  1. Python installed (3.11 <= version <= 3.12)

  2. Install our package:

    pip install uv
    uv tool install --python 3.12 pdf2zh
  3. Execute translation, files generated in current working directory:

    pdf2zh document.pdf

3.2.2 Python: Install using pip

  1. Python installed (3.11 <= version <= 3.12)

  2. Install our package:

    pip install pdf2zh
  3. Execute translation, files generated in current working directory:

    pdf2zh document.pdf

3.3.3 Python: Graphic user interface

  1. Python installed (3.11 <= version <= 3.12)

  2. Install our package:

    pip install pdf2zh
  3. Start using in browser:

    pdf2zh -i
  4. If your browser has not been started automatically, goto

    http://localhost:7860/

See documentation for GUI for more details.

3.2.4 Application: On Windows

  1. Download pdf2zh-version-win64.zip from release page

  2. Unzip and double-click pdf2zh.exe to 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

  1. Pull and run:

    docker pull byaidu/pdf2zh
    docker run -d -p 7860:7860 byaidu/pdf2zh
  2. Open in browser:

    http://localhost:7860/

For docker deployment on cloud service:

Tip

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.com

For PowerShell user:

  $env:HF_ENDPOINT = https://hf-mirror.com

If 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

Topics
chinesedocumenteditenglishjapanesekoreanlatexmathmcpmodifyobsidianopenaipdfpdf2zhpythonrussiantranslatetranslationzotero
Frequently asked

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.

ClaudeWave Trust Score for PDFMathTranslate/PDFMathTranslate
Markdown (README)
[![ClaudeWave Trust Score for PDFMathTranslate/PDFMathTranslate](https://claudewave.com/api/badge/pdfmathtranslate-pdfmathtranslate)](https://claudewave.com/en/repo/pdfmathtranslate-pdfmathtranslate)
HTML
<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>

What the badge means and how the score is computed

Project homepage
https://pdf2zh.com