← All templates · Files and documents
Deploy PDFMathTranslate in one click
Translates scientific PDFs and keeps their formulas, charts and layout
A self-hosted alternative to DeepL and Google Translate.
What is PDFMathTranslate?
PDFMathTranslate is an open-source PDF translator for scientific papers, an alternative to putting them through DeepL. A layout model marks the formulas, figures and tables on each page; they stay as they are, and only the text around them is translated and set back in place. Upload a file or paste a link, such as an arXiv PDF, and you get two downloads: the translation alone, and a dual PDF where each original page is followed by its translation.
People self-host it so a lab or a reading group has a page of its own, with its own API keys, instead of sharing the public demo and its limited computing resources. It is AGPL-3.0, and its paper was accepted at EMNLP 2025. The catch: running PDFMathTranslate yourself does not keep a paper to yourself. Its text still goes to the translation service you pick, unless that is a model you run, such as one in Ollama.
Hosting PDFMathTranslate on Pethost
- You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
- New project opens at PDFMathTranslate. You fill in what it asks for and click Create project: Admin password.
- In a minute or two PDFMathTranslate is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
- It is a project like any other: you or your agent can change it, roll it back or restore it.
Questions about PDFMathTranslate
Is PDFMathTranslate free?
Yes. PDFMathTranslate is open source under the AGPL-3.0 licence. Only the translation service can cost money: DeepL's API or an OpenAI model bills your own account with them.
Which translation services does PDFMathTranslate support?
Google and Bing work with no key; DeepL, OpenAI, Azure OpenAI, Gemini, DeepSeek, Grok, Groq, Zhipu, Tencent and more take yours. Any OpenAI-compatible API and local models through Ollama or Xinference work too.
What is the difference between PDFMathTranslate and PDFMathTranslate-next?
PDFMathTranslate is the original project and its stable line, pdf2zh 1.x. PDFMathTranslate-next carries version 2.0, with more translation-quality fixes; the original's README calls it a fork meant for development, not for community contributions.
What languages does PDFMathTranslate support?
Its web page translates between ten languages: English, Simplified and Traditional Chinese, French, German, Italian, Japanese, Korean, Russian and Spanish. The pdf2zh command line takes other language codes with -li and -lo, where the chosen service supports them.
Can I put PDFMathTranslate behind a login?
Yes. Started with --authorized and a file of users, one name and password per line separated by a comma, its web page asks for a login. This template turns that on for one user, admin, with the password you choose.
How much memory and disk does PDFMathTranslate need?
PDFMathTranslate is moderate: about 650 MB at rest, and its layout model takes more memory and CPU on each paper. On Pethost the Starter plan is enough for it, with room for other apps beside it.
PDFMathTranslate Docker Compose file
The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.
Containers: pdf2zh (byaidu/pdf2zh:1.9.11).
Volumes, in the nightly backup: config.
services:
pdf2zh:
image: byaidu/pdf2zh:1.9.11
restart: unless-stopped
environment:
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
# Without a file of users the web page is open to anyone with the address, and each visitor's
# PDFs are translated on this machine: the user admin with the password given is the only one.
entrypoint:
- sh
- -c
- |
printf 'admin,%s\n' "$$ADMIN_PASSWORD" > /tmp/users.txt
exec pdf2zh -i --authorized /tmp/users.txt
volumes:
# The services' settings and API keys entered on the page.
- config:/root/.config/PDFMathTranslate
volumes:
config:
More in Files and documents
- NextcloudFile sync, calendar and contacts on a server of your own
- Paperless-ngxA document archive with OCR and full-text search
- BentoPDFPDF tools in the browser: merge, split, compress, sign, convert and edit, with the files never leaving it
- copypartyA file server in the browser: resumable uploads, a media player and share links, with WebDAV
- GopeedA fast download manager in the browser: HTTP, BitTorrent and magnet links, with extensions
- OpenListOne file list over many storages: cloud drives, S3, WebDAV and more, browsed, previewed and shared in the browser
