# PDFMathTranslate — Translate PDF Papers Preserving Format > Translate PDF scientific papers while preserving math formulas, charts, and layout. Supports Google, DeepL, OpenAI, Ollama. CLI, GUI, MCP, Docker, Zotero plugin. ## Install Copy the content below into your project: # PDFMathTranslate — Translate PDF Papers Preserving Format ## Quick Use ```bash pip install pdf2zh # Translate a PDF (entire document) pdf2zh input.pdf # Translate specific pages with DeepL pdf2zh input.pdf -p 1-10 -s deepl # Use OpenAI for translation pdf2zh input.pdf -s openai:gpt-4o # Use local Ollama model pdf2zh input.pdf -s ollama:qwen2.5 ``` **GUI mode:** ```bash pdf2zh -g # Opens a web interface at http://localhost:7860 ``` **Docker:** ```bash docker run -d -p 7860:7860 byaidu/pdf2zh ``` ## Intro PDFMathTranslate (pdf2zh) solves the hardest problem in academic PDF translation: preserving mathematical formulas, charts, tables, and layout while translating text. Most translation tools butcher LaTeX equations and destroy figure layouts — pdf2zh keeps them pixel-perfect. Featured at EMNLP 2025, it supports 10+ translation backends including Google Translate, DeepL, OpenAI, Anthropic, and local models via Ollama. Integrates with Zotero for one-click translation of your research library. Available as CLI, GUI, Docker, and even an MCP server. ## Details ### Translation Backends | Backend | Quality | Speed | Cost | |---------|---------|-------|------| | **Google Translate** | Good | Fast | Free | | **DeepL** | Excellent | Fast | Free tier available | | **OpenAI (GPT-4o)** | Excellent | Moderate | API cost | | **Anthropic (Claude)** | Excellent | Moderate | API cost | | **Ollama (local)** | Good | Depends on GPU | Free | | **Azure Translate** | Good | Fast | Free tier | ### What Gets Preserved - **Math formulas** — LaTeX equations rendered correctly in output - **Charts and figures** — untouched, positioned correctly - **Tables** — structure preserved, text translated - **References and citations** — formatting maintained - **Page layout** — columns, margins, headers/footers kept - **Hyperlinks** — clickable links preserved ### Zotero Integration Install the Zotero plugin from [GitHub Releases](https://github.com/Byaidu/PDFMathTranslate/releases). Right-click any PDF in your Zotero library → "Translate with pdf2zh". Translated PDF appears alongside the original. ### Output Options - **Dual-column PDF** — original + translation side by side - **Translated PDF** — clean translated version only - **Bilingual mode** — original text with translation below each paragraph ## Frequently Asked Questions **Q: How accurate is the formula preservation?** A: pdf2zh uses a dedicated math detection pipeline. LaTeX formulas are extracted, left untranslated, and re-inserted. Accuracy is 95%+ for standard academic papers. **Q: What languages are supported?** A: Depends on the translation backend. Google Translate supports 100+ languages. The tool itself is language-agnostic. **Q: Can I translate a 500-page textbook?** A: Yes, but use page ranges (`-p 1-50`) for better control. Large documents may need more API quota. **Q: Does it work offline?** A: Yes, with Ollama backend. Install a translation-capable model and translate without internet. ## Works With - Any PDF scientific paper - Google Translate, DeepL, OpenAI, Anthropic, Ollama - Zotero reference manager - Docker, Python 3.12+ ## Source & Thanks - **GitHub**: [Byaidu/PDFMathTranslate](https://github.com/Byaidu/PDFMathTranslate) — 32,600+ stars, AGPL-3.0 License - **PyPI**: `pdf2zh` - Featured at EMNLP 2025 --- # PDFMathTranslate — 保留格式翻译学术 PDF ## 快速使用 ```bash pip install pdf2zh pdf2zh paper.pdf ``` ## 介绍 翻译学术 PDF 同时完美保留数学公式、图表和版式。支持 Google/DeepL/OpenAI/Ollama 等 10+ 翻译后端。EMNLP 2025 入选。32,600+ stars,支持 CLI、GUI、Docker、Zotero 插件。 ## 来源与感谢 - **GitHub**: [Byaidu/PDFMathTranslate](https://github.com/Byaidu/PDFMathTranslate) — 32,600+ stars, AGPL-3.0 许可证 --- Source: https://tokrepo.com/en/workflows/4c628f43-c803-45c8-ae39-a4caded80419 Author: TokRepo精选