Repository avatar
Version Control
v1.0.3
active

rosettex

io.github.20235106-huynk/rosettex

Translate scientific papers (TeX source or born-digital PDF) and rebuild the PDF with its layout.

Documentation

rosettex ๐Ÿ“œโœจ

Translate scientific papers into 19+ languages โ€” and keep the paper's own layout.

PyPI CI Python Agents License: MIT

Quick Install โ€ข Features โ€ข How It Works โ€ข Connect Your Agent โ€ข Languages โ€ข Manual Install

Page 1 of a paper in English (left) and the same page translated into Vietnamese by rosettex (right)

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).


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

FeatureDescription
๐Ÿค– Built for agentsEvery 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 layoutFrom 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 formulasMath, 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 checksrosettex check catches lost placeholders, changed numbers, glossary violations, untranslated text and over-long answers before anything is built.
๐Ÿ” Repair loopWhen text does not fit, build answers needs_repair with the segments to shorten and by how much; nothing is silently cut.
๐ŸŒ Many scriptsLatin, Cyrillic, CJK, Arabic/Persian/Urdu, Devanagari, Bengali, Tamil, Thai, Myanmar, Ethiopic โ€ฆ with bundled fonts (Noto, Vazirmatn) and copy/search-friendly output.
๐Ÿ”Œ One plugin, many harnessesClaude 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, WindowsCI builds translated PDFs (Vietnamese, Arabic, Japanese) on all three.

๐Ÿ”€ Two Routes

From TeX sourceFrom a born-digital PDF
Inputfolder, archive, arXiv ID or linka PDF with a text layer (journals, arXiv PDF-only, Word exports)
Outputthe paper recompiled with LuaLaTeX in the target languagethe original pages with translated text in the same boxes
Best forany paper with source; changes of writing direction (e.g. English โ†’ Arabic)papers without source

๐Ÿ”„ How It Works

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]
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.

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 must be on PATH. The first run of setup installs TeX (the agent asks you first).

Install as a plugin

HarnessCommand
Claude Code/plugin marketplace add 20235106-huynk/rosettex, then /plugin install rosettex@rosettex
Claude Desktop / claude.aiCustomize โ€บ Plugins โ€บ Add marketplace 20235106-huynk/rosettex
Codex CLI / ChatGPT desktopcodex plugin marketplace add 20235106-huynk/rosettex, then install rosettex from /plugins (or the app's Plugins directory)
GitHub Copilot CLIcopilot 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
Antigravityagy plugin install https://github.com/20235106-huynk/rosettex (or the strict-clean slim package in plugins/antigravity)
Gemini CLIgemini extensions install https://github.com/20235106-huynk/rosettex
Hermeshermes 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 Droiddroid plugin marketplace add 20235106-huynk/rosettex, then droid plugin install rosettex@rosettex
Auggieauggie plugin marketplace add 20235106-huynk/rosettex
Junie CLI/extensions marketplace add 20235106-huynk/rosettex, then /extensions install rosettex
Qwen Codeqwen extensions install 20235106-huynk/rosettex
goosegoose plugin install https://github.com/20235106-huynk/rosettex.git
Kiro IDEPowers โ€บ 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:
{ "mcpServers": { "rosettex": { "command": "uvx", "args": ["rosettex", "mcp"] } } }
Harnesses with their own MCP syntax
HarnessWhereEntry
OpenCodeopencode.json"mcp": { "servers": { "rosettex": { "type": "local", "command": ["uvx", "rosettex", "mcp"] } } }
Kilokilo.jsonc"mcp": { "rosettex": { "type": "local", "command": ["uvx", "rosettex", "mcp"] } }
Crushcrush.json"mcp": { "rosettex": { "type": "stdio", "command": "uvx", "args": ["rosettex", "mcp"] } }
gooseconfig.yamlextensions: { rosettex: { name: rosettex, type: stdio, enabled: true, cmd: uvx, args: [rosettex, mcp], envs: {}, timeout: 300 } }
Mistral Vibeconfig.toml[[mcp_servers]] with name = "rosettex", transport = "stdio", command = "uvx", args = [...]
AmpCLIamp mcp add rosettex -- uvx rosettex mcp
Zedsettings.json"context_servers": { "rosettex": { "command": "uvx", "args": [...] } }
ZencoderVS Code settings.json"zencoder.mcpServers" with the standard block
Visual Studio%USERPROFILE%\.mcp.json"servers": { "rosettex": { "command": "uvx", "args": [...] } }
GitHub Copilot cloud agentrepository 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."

๐Ÿ› ๏ธ Manual Install

Commands, requirements and environment variables

Requirements

  • Python โ‰ฅ 3.11 and 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.
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

uv tool upgrade rosettex && rosettex install-skill --force
rosettex install-skill --remove && uv tool uninstall rosettex   # then delete the folder ~/.rosettex

๐ŸŒ Languages

Language data covers about 50 target languages (src/rosettex/data/langs/). Tested end to end:

ScriptLanguages
LatinVietnamese, French
CyrillicRussian
Han / Kana / HangulChinese (Simplified, Traditional), Japanese, Korean
Arabic (RTL)Arabic, Persian, Urdu
IndicHindi, Bengali, Gujarati, Kannada, Tamil, Telugu
Southeast AsianThai, Myanmar
EthiopicAmharic

โš ๏ธ 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.

๐Ÿ“„ License

MIT โ€” see LICENSE. Bundled fonts are under the SIL Open Font License 1.1 (src/rosettex/data/fonts/LICENSES/). Release notes: CHANGELOG.md.

PYPI
rosettex
Install Command
pip install rosettex
Runtime: uvx