Beta

LaTeX PDF Translator

Translate LaTeX-typeset PDFs to English. All math notation stays as searchable vector text.

This tool is in beta. Feedback welcome.

→ English

Drop your PDF here

or browse files

.pdf · max 50 MB

Your PDF is processed on my server and not stored after translation. The first request may take a minute while the server wakes up. Translation speed depends on document length, as each text block is sent sequentially to Google Translate's free API. The server runs on a free hosting tier, so processing is slower than a dedicated machine.

How it works

The tool reads PDF text spans directly and classifies each one as either translatable text or mathematical notation based on the embedded font (e.g. CMMI, CMSY, CMEX for math). Text spans are sent to Google Translate with placeholder tokens where math appears. The translated text is then re-rendered into the PDF using CMU Serif and Latin Modern Math, keeping all output as searchable vector text.

Bold, italic, and bold-italic styles are preserved. Table of contents entries, dot leaders, page numbers, and hyperlink annotations are regenerated. Pure-text blocks (without math) are merged into paragraphs before translation for more natural results.

Command line

Clone the repo and run with uv. No configuration needed.

# Clone and install
$ git clone https://github.com/joshuaswanson/latex-pdf-translator
$ cd latex-pdf-translator

# Translate a French PDF to English
$ uv run main.py lecture-notes.pdf --source fr

# Translate German to Spanish
$ uv run main.py notes.pdf --source de --target es

Extracting translatable lines...
Found 847 translatable lines across 54 pages
Translating via Google Translate...
  312 cached, 535 to translate
Rendering translations...
Saved: lecture-notes-en.pdf