Translate LaTeX preserving equations
This repo lets you translate arXiv or LaTeX projects with your own LLM API, keeping equations, citations and structure intact, and outputs a PDF and editable source.
Mengqi-Lei/texglot
Translate arXiv papers and LaTeX projects with your own LLM API, preserving equations, citations, and document structure. Generate translated PDFs and editable source through a local app or batch CLI.
THE USEFUL PART
Translate arXiv papers and LaTeX projects with your own LLM API, preserving equations, citations, and document structure. Generate translated PDFs and editable source through a local app or batch CLI.
THE STACKRADAR WALKTHROUGH
A short introduction from our reel. See the project README for the current details.
This repo lets you translate arXiv or LaTeX projects with your own LLM API, keeping equations, citations and structure intact, and outputs a PDF and editable source.
Compare originals and translations side by side.
You can batch translate many papers from the terminal, resume interrupted jobs and reuse cached paragraphs, then export translated PDFs and source ZIPs.
GITHUB SNAPSHOT
Recorded counts, not a growth rate or a quality score.
OBSERVED STAR HISTORY
2 real daily observations. 128 → 127 stars.

FROM THE PROJECT
Source excerpts from the project's README. Not an independent review, verification or security audit.
TeXGlot Read papers across languages. Keep the LaTeX. Local arXiv & LaTeX translation · Your model API · PDF + editable source
English · 简体中文 News · Quick start · Example · CLI · Zotero plugin · Contributing · Release notes
https://github.com/user-attachments/assets/0f7d9dbb-3daf-412e-b3db-6f328421c396
2026-09-25: 🔥 TeXGlot for Zotero is released: start translations, reuse existing results and read both PDFs side by side inside Zotero. Plugin guide
2026-09-10: The first public TeXGlot release brings local arXiv / LaTeX translation, PDF comparison and a CLI.
TeXGlot takes an arXiv link or a LaTeX project, translates its prose with your configured language model, and compiles a translated PDF. Equations, citations, figures and document structure are protected throughout the process. The translated LaTeX project remains available for editing.
The name combines TeX + Polyglot. The browser interface and CLI use the same local library, queue and translation cache. No TeXGlot account or hosted backend is required. Model requests go to the API endpoint you choose.
| What you can do | |
|---|---|
| Source to PDF | Import arXiv links/IDs or .tex, .zip, .tar, .tar.gz, .tgz, .gz projects. Download the translated PDF, original PDF and translated source ZIP. |
| Your model | Use DeepL, Qwen / Alibaba Model Studio, DeepSeek, or a compatible Chat Completions endpoint, including a local model service. |
| Context guidance | Optionally use the paper's abstract to guide terminology. On by default; independently selectable for each task in the GUI and CLI. |
| Reading workspace | Read original, translation or both; swap sides, scroll continuously, synchronize by shared content landmarks, search the full PDF with Cmd/Ctrl+F, zoom and resume your reading position. |
| Local annotations | Highlight, underline and add notes. Search and manage annotations in a sidebar; exported PDFs stay free of TeXGlot annotations. |
| Batch & resume | Translate multiple papers from the terminal, resume interrupted tasks, reuse valid paragraph caches and export machine-readable results. |
| Desktop updates | Get release reminders, download a verified installer and open it from the app. Update guide. |
| Two interface languages | Chinese and English UI, independently of the translation target: Simplified Chinese, Traditional Chinese or English. |
Actual TeXGlot reader showing aligned prose and experimental results from Attention Is All You Need (Vaswani et al., NeurIPS 2017).
Choose the desktop installer for your computer from Releases:
| Computer | Installer | Install |
|---|---|---|
| Mac · Apple Silicon | TeXGlot-1.2.9-macOS-arm64.dmg | Open and drag into Applications |
| Mac · Intel | TeXGlot-1.2.9-macOS-x64.dmg | Open and drag into Applications |
| Windows · x64 | TeXGlot-1.2.9-Windows-x64-Setup.exe | Run setup and open the desktop shortcut |
Python, the interface and Tectonic are included. No Python, Node.js or uv installation is required. First compilation downloads TeX packages and fonts; papers with EPS figures additionally require Ghostscript. The initial packages have no publisher signing certificate / Apple notarization, so the OS may show an unknown-publisher warning. See the desktop guide for installation, migration and platform validation. Only verified assets are attached to a release.
Install from source (developers and CLI users)
Download and extract texglot-1.2.9-source.zip from Releases, or clone the repository:
git clone https://github.com/Mengqi-Lei/texglot.git
cd texglot
Install uv and Node.js 22.12+, then reopen your terminal. Setup prepares Python 3.13, builds the interface and installs the CLI. It reuses an installed Tectonic compiler, or downloads a checksum-verified portable copy. The first installation and first compilation need internet access for dependencies, TeX packages and fonts.
macOS
bash scripts/setup.sh
bash start-texglot.command
After installation, you can also double-click start-texglot.command in Finder.
Windows 10/11 x64
Double-click install-texglot.cmd, then start-texglot.cmd. Alternatively, in PowerShell:
.\install-texglot.cmd
.\start-texglot.cmd
No WSL is required. For source installations, prefer a short folder such as D:\TeXGlot. The Apple Silicon desktop app was tested locally. Intel Mac and Windows x64 passed native builds and frozen-engine translation checks; Windows also passed EXE installation. See platform details for interactive desktop and Linux test coverage.
Open TeXGlot (or http://127.0.0.1:8765 for a source installation), choose Translation settings, select a provider, enter its API base URL, model and key, then Test connection and save.
| Provider | Model preset | API base URL |
|---|---|---|
| Qwen / Alibaba Model Studio | qwen3.8-flash | Copy the OpenAI-compatible endpoint from your workspace's API Key page. It must match the key's region and workspace. |
| DeepSeek V4.1 Flash | deepseek-flash | https://api.deepseek.com |
| DeepL | No model name needed | https://api.deepl.com; legacy Free keys automatically use the Free endpoint. |
| Custom / local | Your installed or available model | For example, http://localhost:11434/v1 for Ollama. A local endpoint without authentication can use an empty key. |
Presets are editable. Model availability and billing depend on your provider account. Qwen requests disable thinking by default. Refer to the Qwen quick start or DeepSeek documentation for credentials and endpoint details.
DeepL uses its own DeepL API key and does not require an LLM account. Select DeepL, test the connection and save; usage is shown in characters. TeXGlot protects and validates formulas, citations and formatting. Optionally provide a DeepL glossary ID and its source language; existing free-form LLM terminology preferences are retained. See DeepL API authentication for API account requirements.
Paste an arXiv link, or upload a LaTeX project including its figures, bibliography and template files. Choose the target language and context guidance, then click Translate. Open the result to compare the PDFs or download the translated source.
The interface starts in Chinese; use EN in the header to switch. The empty library's Translate Attention Is All You Need action downloads the pinned arXiv paper and translates it using your selected target language, context guidance and configured API. Quit the desktop app through its menu. For a source installation, close the launch terminal or press Ctrl+C to stop the foreground service; your library is retained.
Try the original Transformer paper, pinned to arXiv:1706.03762v7:
texglot https://arxiv.org/abs/1706.03762v7 --language zh --context-guidance -o ./translated
The bilingual walkthrough covers the GUI, CLI, expected artifacts and result checks. A one-line batch file is included. This is a real model-backed translation and incurs your provider's normal usage charges.
The example downloads source from arXiv when you run it. The repository does not redistribute the paper, its source archive or its full translation.
Desktop packages include a CLI engine; source or wheel installation provides the shorter commands below. No browser needs to be open:
texglot --configure # interactive setup; hidden key input
texglot 1706.03762v7 # one paper
texglot ./paper.tex ./project.zip -o ./out # multiple inputs
texglot --batch papers.txt --language zh # one source per line
texglot --batch papers.txt --no-context-guidance
texglot --resume TASK_ID # resume, wait or export
texglot --list
texglot --serve # foreground local web service
If the command is not found, run uv tool update-shell and reopen the terminal. From the checkout, uv run python -m app.cli accepts the same arguments.
Batch lists support comments and resolve relative input paths from the list's directory. Each task exports into a separate folder. A failed paper does not stop later papers unless you pass --fail-fast. --json writes results to stdout and progress to stderr; exit code 1 includes partial translations that need review. See the complete CLI guide.
TeXGlot for Zotero lets you start paper translations, reuse results from your TeXGlot library and read the original and translation side by side in Zotero's native reader. Translations become child attachments of the paper; existing PDFs and annotations are preserved. The plugin works with TeXGlot running on the same computer.
For installation, translation, reading controls and troubleshooting, see the Zotero plugin guide.
Import and preflight. Safely unpack the source, find the main file and compile the original. Check the target-language font/template before model translation.
Protect and translate. Extract prose, protect LaTeX syntax, formulas and references with markers, then call the configured model with bounded concurrency.
Use context when enabled. Share the explicitly marked source abstract across paragraphs, up to 6,000 characters. No readable abstract means no added context. Turning guidance off removes this background, while terminology and structure protection still apply.
Validate and cache. Check protected markers, structure and target language. Retry invalid output; preserve the original paragraph and report a partial result if recovery fails. Save successful translations for resumption.
Compile and export. Rebuild the LaTeX project into a searchable PDF and retain editable source. Read the result locally with content-based synchronization.
Source installations store settings, tasks, caches and annotations in data/; desktop and standalone wheel installations use ~/.texglot/. TEXGLOT_DATA_DIR overrides the location. Back up this directory before moving or upgrading an installation.
API keys are stored locally, not encrypted at rest. Configuration files use owner-only permissions on macOS/Linux and the containing user's ACL on Windows. API responses do not expose saved keys. A new API address does not inherit another address's key.
Translation paragraphs, optional abstract context and your glossary are sent to your chosen model service. Source processing, compilation and annotation storage run locally. Use a local model endpoint if the text must remain on your machine.
The service binds to loopback. It is a personal local application, not an authenticated multi-user server. macOS uses an OS compilation sandbox; Windows/Linux do not yet provide equivalent OS-level file isolation. Use trusted LaTeX sources.
See the scope and troubleshooting guide for supported inputs, template compatibility and solutions to common issues.
Contributions to translation quality, templates, accessibility, documentation and platform testing are welcome. Start with the English contribution guide or 中文贡献指南 for local development, architecture, test commands, commit conventions and pull requests. Plugin build and test instructions are in the Zotero development guide.
TeXGlot was inspired by 幻觉翻译 and draws on its related features. TeXGlot is independently implemented. Thanks to the maintainers of Tectonic, PDF.js, React, FastAPI and the other dependencies listed in THIRD_PARTY.md.
TeXGlot is licensed under Apache License 2.0. Bundled fonts, character maps and other third-party resources retain their respective licenses. Research papers used with the tool retain their original rights.
Read the original READMEKEEP EXPLORING
Repository preview
strelov1/freehire
Open-source search engine aggregating 3.3M+ tech jobs directly from 294k+ company career pages. Zero recruiters, no reposts.
git clone https://github.com/strelov1/freehire.gitzenhostai/9drive
Virtual storage gateway pooling multiple free Google Drive accounts into a combined 60GB+ high-speed personal bucket.
git clone https://github.com/zenhostai/9drive.git
Repository screenshot
exoteric33/ps2-native-recomp
Turns a PS2 disc image into a native PC program by static recompilation; builds on ps2-web-recomp (MIT). Work in progress. Bring your own disc.
git clone https://github.com/exoteric33/ps2-native-recomp.gitShort demos. New discoveries. Less noise in your feed.