rosettex
<!-- mcp-name: io.github.20235106-huynk/rosettex -->
<div align="center">
# rosettex ๐โจ
**Translate scientific papers into 19+ languages โ and keep the paper's own layout.**
[](https://pypi.org/project/rosettex/)
[](https://github.com/20235106-huynk/rosettex/actions/workflows/ci.yml)
[](https://pypi.org/project/rosettex/)
[](#-connect-your-agent)
[](https://github.com/20235106-huynk/rosettex/blob/main/LICENSE)
[Quick Install](#-quick-install-let-your-agent-do-it) โข [Features](#-key-features) โข [How It Works](#-how-it-works) โข [Connect Your Agent](#-connect-your-agent) โข [Languages](#-languages) โข [Manual Install](#-manual-install)
<img src="https://raw.githubusercontent.com/20235106-huynk/rosettex/main/assets/demo-pdf-vi.png" alt="Page 1 of a paper in English (left) and the same page translated into Vietnamese by rosettex (right)" width="900">
<sub>A born-digital PDF (left) and rosettex's Vietnamese output (right): same page, same figure, same fonts for names and
formulas. Paper: Berestov et al., CEUR-WS Vol-3550 (CC BY 4.0).</sub>
</div>
---
`rosettex` lets an **AI coding agent** translate a whole scientific paper โ from its **TeX source** or from a
**born-digital PDF** โ and returns a PDF with the paper's own layout.
**rosettex does not translate by itself โ your agent is the translator.** rosettex does the engineering around it: it
splits the paper into question sheets with protected placeholders, checks every answer against strict rules, and
typesets the result so formulas, figures, citations and links stay real, selectable and clickable. It ships as a CLI, an
MCP server and an Agent Skill, packaged as a plugin for the major agent harnesses.
## ๐ Key Features
| Feature | Description |
|---|---|
| ๐ค **Built for agents** | Every command speaks `--json` and returns the next command to run (`next_argv`); an agent can drive the whole loop and resume after any interruption. |
| ๐ **Original layout** | From TeX source the paper is rebuilt with its own class and packages; from a PDF the original pages are kept and only the text in the translated boxes is replaced. |
| ๐งฎ **Formulas stay formulas** | Math, citations and links become placeholders (`โฆm1โง`, `โฆl2โง`) the translation must keep; on PDFs they are copied as vector snippets of the original, and a formula the agent copies verbatim is protected automatically. |
| ๐ก๏ธ **Strict checks** | `rosettex check` catches lost placeholders, changed numbers, glossary violations, untranslated text and over-long answers before anything is built. |
| ๐ **Repair loop** | When text does not fit, `build` answers `needs_repair` with the segments to shorten and by how much; nothing is silently cut. |
| ๐ **Many scripts** | Latin, Cyrillic, CJK, Arabic/Persian/Urdu, Devanagari, Bengali, Tamil, Thai, Myanmar, Ethiopic โฆ with bundled fonts (Noto, Vazirmatn) and copy/search-friendly output. |
| ๐ **One plugin, many harnesses** | Claude Code, Codex, GitHub Copilot, VS Code, Cursor, Antigravity, Gemini CLI, Hermes, Devin and more install it from this repository; any MCP client or Agent Skills host can use it too. |
| ๐ป **Linux, macOS, Windows** | CI builds translated PDFs (Vietnamese, Arabic, Japanese) on all three. |
## ๐ Two Routes
| | From TeX source | From a born-digital PDF |
|---|---|---|
| **Input** | folder, archive, arXiv ID or link | a PDF with a text layer (journals, arXiv PDF-only, Word exports) |
| **Output** | the paper recompiled with LuaLaTeX in the target language | the original pages with translated text in the same boxes |
| **Best for** | any paper with source; changes of writing direction (e.g. English โ Arabic) | papers without source |
## ๐ How It Works
```mermaid
flowchart LR
A[๐ TeX source<br/>or PDF] --> B[๐งฉ rosettex prepare<br/>sheets + placeholders]
B --> C[๐ค Your agent<br/>translates]
C --> D[๐ก๏ธ rosettex check<br/>placeholders ยท numbers ยท terms]
D --> E[๐๏ธ rosettex build<br/>LuaLaTeX]
E -->|needs_repair| C
E --> F[๐ Translated PDF]
```
```bash
rosettex fetch 2108.07760 -o work # folder, archive, arXiv ID/link, or a local .pdf
rosettex prepare work --lang vi # question sheets in work/read/, glossary in work/terms.md
# โฆ the agent appends "sNNNN <translation>" lines to work/out/NN.txt โฆ
rosettex check work # repeat until ok
rosettex build work --out paper.vi.pdf # may ask for shorter text (needs_repair), then build again
```
## ๐ Quick Install: Let Your Agent Do It
> [!TIP]
> Copy the prompt below and send it to your coding agent. It installs everything into your home folder and asks before
> any download.
```text
Install rosettex (https://github.com/20235106-huynk/rosettex) and connect it to yourself: install uv if it is
missing, then `uv tool install rosettex`, `rosettex setup` (follow its next_argv), `rosettex doctor`, and the rosettex
plugin for your harness from the README (or `rosettex install-skill`). No sudo; ask me before any download or installer.
```
Then just ask, for example: *"Translate arXiv 1512.03385 into Simplified Chinese and save it as ~/papers/resnet.zh.pdf."*
The agent fetches the paper, picks the field and key terms, translates sheet by sheet, runs `check` until it passes,
builds the PDF, shortens any text `build` reports as too long, and tells you where the PDF is.
## ๐ Connect Your Agent
This repository is a plugin at its root: one skill (`skills/rosettex`) and one MCP server that `uvx` starts from the
release on PyPI (`uvx rosettex==<version> mcp`), so [uv](https://docs.astral.sh/uv/) must be on PATH. The first run of `setup` installs TeX (the agent
asks you first).
### Install as a plugin
| Harness | Command |
|---|---|
| **Claude Code** | `/plugin marketplace add 20235106-huynk/rosettex`, then `/plugin install rosettex@rosettex` |
| **Claude Desktop / claude.ai** | Customize โบ Plugins โบ Add marketplace `20235106-huynk/rosettex` |
| **Codex CLI / ChatGPT desktop** | `codex plugin marketplace add 20235106-huynk/rosettex`, then install `rosettex` from `/plugins` (or the app's Plugins directory) |
| **GitHub Copilot CLI** | `copilot plugin install 20235106-huynk/rosettex` |
| **VS Code (Copilot)** | *Chat: Install Plugin from Source* with the repository URL, or add `20235106-huynk/rosettex` to `chat.plugins.marketplaces` |
| **Antigravity** | `agy plugin install https://github.com/20235106-huynk/rosettex` (or the strict-clean slim package in `plugins/antigravity`) |
| **Gemini CLI** | `gemini extensions install https://github.com/20235106-huynk/rosettex` |
| **Hermes** | `hermes plugins install 20235106-huynk/rosettex/plugins/hermes`, then `hermes plugins enable rosettex` |
| **Devin** (Desktop, CLI, cloud) | `devin plugins install 20235106-huynk/rosettex`; cloud: Customize โบ Add plugin โบ From repository |
| **Factory Droid** | `droid plugin marketplace add 20235106-huynk/rosettex`, then `droid plugin install rosettex@rosettex` |
| **Auggie** | `auggie plugin marketplace add 20235106-huynk/rosettex` |
| **Junie CLI** | `/extensions marketplace add 20235106-huynk/rosettex`, then `/extensions install rosettex` |
| **Qwen Code** | `qwen extensions install 20235106-huynk/rosettex` |
| **goose** | `goose plugin install https://github.com/20235106-huynk/rosettex.git` |
| **Kiro IDE** | Powers โบ Add Custom Power โบ Import power from a repository URL |
### Skill + MCP server (every other harness)
1. Install the skill: `rosettex install-skill` (writes `~/.agents/skills`, `~/.claude/skills`, `~/.gemini/config/skills`,
and the Cline, Kiro, Qoder, Trae and CodeBuddy skill folders when they exist), or `npx skills add 20235106-huynk/rosettex`.
2. Add the MCP server. Most harnesses (Cursor, Cline, Kiro, Qoder, Kimi Code, Pi, CodeBuddy, Warp, Junie, Auggie, Tabnine,
Trae, JetBrains AI Assistant) take the standard block in their MCP settings:
```json
{ "mcpServers": { "rosettex": { "command": "uvx", "args": ["rosettex", "mcp"] } } }
```
<details>
<summary><b>Harnesses with their own MCP syntax</b></summary>
| Harness | Where | Entry |
|---|---|---|
| OpenCode | `opencode.json` | `"mcp": { "servers": { "rosettex": { "type": "local", "command": ["uvx", "rosettex", "mcp"] } } }` |
| Kilo | `kilo.jsonc` | `"mcp": { "rosettex": { "type": "local", "command": ["uvx", "rosettex", "mcp"] } }` |
| Crush | `crush.json` | `"mcp": { "rosettex": { "type": "stdio", "command": "uvx", "args": ["rosettex", "mcp"] } }` |
| goose | `config.yaml` | `extensions: { rosettex: { name: rosettex, type: stdio, enabled: true, cmd: uvx, args: [rosettex, mcp], envs: {}, timeout: 300 } }` |
| Mistral Vibe | `config.toml` | `[[mcp_servers]]` with `name = "rosettex"`, `transport = "stdio"`, `command = "uvx"`, `args = [...]` |
| Amp | CLI | `amp mcp add rosettex -- uvx rosettex mcp` |
| Zed | `settings.json` | `"context_servers": { "rosettex": { "command": "uvx", "args": [...] } }` |
| Zencoder | VS Code `settings.json` | `"zencoder.mcpServers"` with the standard block |
| Visual Studio | `%USERPROFILE%\.mcp.json` | `"servers": { "rosettex": { "command": "uvx", "args": [...] } }` |
| GitHub Copilot cloud agent | repository Settings โบ Copilot โบ MCP servers | `"type": "local"`, `"tools": ["*"]`, and install uv in `copilot-setup-steps.yml` |
Harnesses that accept only remote MCP servers (Android Studio, Replit, ChatGPT custom MCP) cannot run this stdio server;
use the skill and the CLI there. Without any integration, tell the agent: *"Run `rosettex guide` and follow it."*
</details>
## ๐ ๏ธ Manual Install
<details>
<summary><b>Commands, requirements and environment variables</b></summary>
### Requirements
- Python โฅ 3.11 and [uv](https://docs.astral.sh/uv/).
- LuaLaTeX: `rosettex setup` installs a private TinyTeX into `~/.rosettex` (asks first; retries flaky CTAN mirrors), or
`rosettex setup --tex system` uses an existing TeX Live.
```bash
uv tool install rosettex
rosettex setup # or: rosettex setup --tex system
rosettex doctor
rosettex install-skill
```
### Environment variables
- `ROSETTEX_HOME`: where rosettex keeps its TeX toolchain and state (default `~/.rosettex`).
### Update and uninstall
```bash
uv tool upgrade rosettex && rosettex install-skill --force
rosettex install-skill --remove && uv tool uninstall rosettex # then delete the folder ~/.rosettex
```
</details>
## ๐ Languages
Language data covers about 50 target languages (`src/rosettex/data/langs/`). Tested end to end:
| Script | Languages |
|---|---|
| **Latin** | Vietnamese, French |
| **Cyrillic** | Russian |
| **Han / Kana / Hangul** | Chinese (Simplified, Traditional), Japanese, Korean |
| **Arabic** (RTL) | Arabic, Persian, Urdu |
| **Indic** | Hindi, Bengali, Gujarati, Kannada, Tamil, Telugu |
| **Southeast Asian** | Thai, Myanmar |
| **Ethiopic** | Amharic |
## โ ๏ธ Limits
- The PDF route needs a born-digital PDF with a text layer (no OCR) and keeps the writing direction: a left-to-right
paper cannot become right-to-left there โ use the TeX source for that.
- Table contents are not translated; scanned PDFs, vertical writing and PDF forms are not supported.
- Very tight layouts may need shorter translations (`needs_repair`) or a slightly smaller font.
## ๐ Privacy and network access
rosettex runs on your machine: no server, no account, no telemetry. It goes online only to download what you ask for โ
a paper from arxiv.org (`fetch`), the TeX toolchain from github.com and mirror.ctan.org (`setup`, after you agree), and
the package from PyPI when `uvx` starts the MCP server. Local papers are never uploaded. Your AI agent, not rosettex,
does the translating; what it sends to its model provider follows that provider's policy. Details:
[`PRIVACY.md`](https://github.com/20235106-huynk/rosettex/blob/main/PRIVACY.md).
## ๐ License
MIT โ see [`LICENSE`](https://github.com/20235106-huynk/rosettex/blob/main/LICENSE). Bundled fonts are under the SIL Open
Font License 1.1 (`src/rosettex/data/fonts/LICENSES/`). Release notes: [`CHANGELOG.md`](https://github.com/20235106-huynk/rosettex/blob/main/CHANGELOG.md).
TDQS
Scored across 10 tools
Most tools map to distinct workflow stages (fetch source, prepare workdir, build PDF, fix a file, install toolchain, diagnose toolchain). The inspection-flavored tools 'check', 'review', and 'status' sit close together, but the descriptions separate them (verify translations vs. produce a review sheet vs. report workdir state).
All names are single lowercase tokens with no camelCase/snake_case mixing, which reads consistently. The only minor deviation is that most are imperative verbs (fetch, prepare, build, fix) while a few are bare nouns (guide, status).
Ten tools is well within the healthy range and each has an identifiable role in the pipeline. The set is slightly heavy on inspection/diagnostics (check, review, status, doctor), but none is clearly redundant.
The surface covers the full lifecycle: install toolchain, fetch source, prepare workdir, check/review translations, edit via fix, typeset, and query state, plus docs. Minor gaps exist โ there is no explicit tool for committing or exporting the finished translation, and 'fix' bundles copy and drop behaviors into one entry point.