rosettex 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rosettex-1.0.0/.agents/plugins/marketplace.json +20 -0
- rosettex-1.0.0/.antigravity-plugin/plugin.json +20 -0
- rosettex-1.0.0/.claude-plugin/marketplace.json +15 -0
- rosettex-1.0.0/.claude-plugin/plugin.json +20 -0
- rosettex-1.0.0/.github/workflows/ci.yml +80 -0
- rosettex-1.0.0/.github/workflows/release.yml +38 -0
- rosettex-1.0.0/.gitignore +23 -0
- rosettex-1.0.0/.mcp.json +13 -0
- rosettex-1.0.0/.python-version +1 -0
- rosettex-1.0.0/CHANGELOG.md +13 -0
- rosettex-1.0.0/LICENSE +25 -0
- rosettex-1.0.0/PKG-INFO +197 -0
- rosettex-1.0.0/README.md +184 -0
- rosettex-1.0.0/assets/demo-pdf-vi.png +0 -0
- rosettex-1.0.0/gemini-extension.json +15 -0
- rosettex-1.0.0/mcp.json +14 -0
- rosettex-1.0.0/mcp_config.json +12 -0
- rosettex-1.0.0/plugin.json +21 -0
- rosettex-1.0.0/plugins/hermes/LICENSE +25 -0
- rosettex-1.0.0/plugins/hermes/README.md +9 -0
- rosettex-1.0.0/plugins/hermes/mcp.json +14 -0
- rosettex-1.0.0/plugins/hermes/plugin.json +21 -0
- rosettex-1.0.0/plugins/hermes/skills/rosettex/SKILL.md +43 -0
- rosettex-1.0.0/plugins/mcp.dev.json +9 -0
- rosettex-1.0.0/pyproject.toml +28 -0
- rosettex-1.0.0/scripts/ci_smoke.py +121 -0
- rosettex-1.0.0/scripts/pseudo_translate.py +633 -0
- rosettex-1.0.0/scripts/roundtrip_gate.py +78 -0
- rosettex-1.0.0/server.json +34 -0
- rosettex-1.0.0/skills/rosettex/SKILL.md +43 -0
- rosettex-1.0.0/src/rosettex/__init__.py +1 -0
- rosettex-1.0.0/src/rosettex/__main__.py +3 -0
- rosettex-1.0.0/src/rosettex/arxiv.py +117 -0
- rosettex-1.0.0/src/rosettex/assemble.py +70 -0
- rosettex-1.0.0/src/rosettex/checks.py +364 -0
- rosettex-1.0.0/src/rosettex/cli.py +1138 -0
- rosettex-1.0.0/src/rosettex/data/__init__.py +0 -0
- rosettex-1.0.0/src/rosettex/data/commands.json +38 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/NotoSerifBengali-OFL.txt +93 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/NotoSerifDevanagari-OFL.txt +93 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/NotoSerifEthiopic-OFL.txt +93 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/NotoSerifGujarati-OFL.txt +93 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/NotoSerifJP-OFL.txt +92 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/NotoSerifKR-OFL.txt +92 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/NotoSerifKannada-OFL.txt +93 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/NotoSerifMyanmar-OFL.txt +93 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/NotoSerifSC-OFL.txt +92 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/NotoSerifTC-OFL.txt +92 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/NotoSerifTamil-OFL.txt +93 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/NotoSerifTelugu-OFL.txt +93 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/NotoSerifThai-OFL.txt +93 -0
- rosettex-1.0.0/src/rosettex/data/fonts/LICENSES/Vazirmatn-OFL.txt +93 -0
- rosettex-1.0.0/src/rosettex/data/fonts/MANIFEST.json +219 -0
- rosettex-1.0.0/src/rosettex/data/fonts/NotoSerifBengali-Regular.ttf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/NotoSerifDevanagari-Regular.ttf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/NotoSerifEthiopic-Regular.ttf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/NotoSerifGujarati-Regular.ttf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/NotoSerifJP-Regular.otf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/NotoSerifKR-Regular.otf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/NotoSerifKannada-Regular.ttf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/NotoSerifMyanmar-Regular.ttf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/NotoSerifSC-Regular.otf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/NotoSerifTC-Regular.otf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/NotoSerifTamil-Regular.ttf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/NotoSerifTelugu-Regular.ttf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/NotoSerifThai-Regular.ttf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/Vazirmatn-Regular.ttf +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/__init__.py +0 -0
- rosettex-1.0.0/src/rosettex/data/fonts/coverage.json +1 -0
- rosettex-1.0.0/src/rosettex/data/instructions.md +19 -0
- rosettex-1.0.0/src/rosettex/data/langs/am.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/ar.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/as.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/be.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/bg.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/bn.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/ckb.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/cs.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/de.json +55 -0
- rosettex-1.0.0/src/rosettex/data/langs/en.json +110 -0
- rosettex-1.0.0/src/rosettex/data/langs/es.json +23 -0
- rosettex-1.0.0/src/rosettex/data/langs/fa.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/fr.json +59 -0
- rosettex-1.0.0/src/rosettex/data/langs/gu.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/hi.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/id.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/it.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/ja.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/kk.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/kn.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/ko.json +46 -0
- rosettex-1.0.0/src/rosettex/data/langs/ky.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/mai.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/mk.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/mn.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/mr.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/ms.json +19 -0
- rosettex-1.0.0/src/rosettex/data/langs/my.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/ne.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/nl.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/pl.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/ps.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/pt.json +26 -0
- rosettex-1.0.0/src/rosettex/data/langs/ro.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/ru.json +39 -0
- rosettex-1.0.0/src/rosettex/data/langs/sa.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/sd.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/sr-Cyrl.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/sr-Latn.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/sr.json +21 -0
- rosettex-1.0.0/src/rosettex/data/langs/sv.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/ta.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/te.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/tg.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/th.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/ti.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/tr.json +20 -0
- rosettex-1.0.0/src/rosettex/data/langs/ug.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/uk.json +38 -0
- rosettex-1.0.0/src/rosettex/data/langs/ur.json +15 -0
- rosettex-1.0.0/src/rosettex/data/langs/vi.json +64 -0
- rosettex-1.0.0/src/rosettex/data/langs/zh-CN.json +16 -0
- rosettex-1.0.0/src/rosettex/data/langs/zh-HK.json +16 -0
- rosettex-1.0.0/src/rosettex/data/langs/zh-Hans.json +18 -0
- rosettex-1.0.0/src/rosettex/data/langs/zh-Hant.json +16 -0
- rosettex-1.0.0/src/rosettex/data/langs/zh-MO.json +16 -0
- rosettex-1.0.0/src/rosettex/data/langs/zh-SG.json +16 -0
- rosettex-1.0.0/src/rosettex/data/langs/zh-TW.json +16 -0
- rosettex-1.0.0/src/rosettex/data/langs/zh.json +16 -0
- rosettex-1.0.0/src/rosettex/data/schemas/build.json +88 -0
- rosettex-1.0.0/src/rosettex/data/schemas/check.json +88 -0
- rosettex-1.0.0/src/rosettex/data/schemas/doctor.json +56 -0
- rosettex-1.0.0/src/rosettex/data/schemas/envelope.json +125 -0
- rosettex-1.0.0/src/rosettex/data/schemas/fetch.json +57 -0
- rosettex-1.0.0/src/rosettex/data/schemas/fix.json +35 -0
- rosettex-1.0.0/src/rosettex/data/schemas/guide.json +32 -0
- rosettex-1.0.0/src/rosettex/data/schemas/install-skill.json +39 -0
- rosettex-1.0.0/src/rosettex/data/schemas/prepare.json +49 -0
- rosettex-1.0.0/src/rosettex/data/schemas/review.json +42 -0
- rosettex-1.0.0/src/rosettex/data/schemas/setup.json +49 -0
- rosettex-1.0.0/src/rosettex/data/schemas/status.json +51 -0
- rosettex-1.0.0/src/rosettex/data/scripts/__init__.py +0 -0
- rosettex-1.0.0/src/rosettex/data/scripts/arabic.json +24 -0
- rosettex-1.0.0/src/rosettex/data/scripts/bengali.json +21 -0
- rosettex-1.0.0/src/rosettex/data/scripts/cyrillic.json +19 -0
- rosettex-1.0.0/src/rosettex/data/scripts/devanagari.json +21 -0
- rosettex-1.0.0/src/rosettex/data/scripts/ethiopic.json +21 -0
- rosettex-1.0.0/src/rosettex/data/scripts/gujarati.json +21 -0
- rosettex-1.0.0/src/rosettex/data/scripts/han.json +26 -0
- rosettex-1.0.0/src/rosettex/data/scripts/hangul.json +30 -0
- rosettex-1.0.0/src/rosettex/data/scripts/kana.json +27 -0
- rosettex-1.0.0/src/rosettex/data/scripts/kannada.json +21 -0
- rosettex-1.0.0/src/rosettex/data/scripts/latin.json +21 -0
- rosettex-1.0.0/src/rosettex/data/scripts/myanmar.json +22 -0
- rosettex-1.0.0/src/rosettex/data/scripts/tamil.json +20 -0
- rosettex-1.0.0/src/rosettex/data/scripts/telugu.json +21 -0
- rosettex-1.0.0/src/rosettex/data/scripts/thai.json +20 -0
- rosettex-1.0.0/src/rosettex/data/skill/rosettex/SKILL.md +43 -0
- rosettex-1.0.0/src/rosettex/escape.py +87 -0
- rosettex-1.0.0/src/rosettex/jsonio.py +24 -0
- rosettex-1.0.0/src/rosettex/langdata.py +91 -0
- rosettex-1.0.0/src/rosettex/mcp.py +176 -0
- rosettex-1.0.0/src/rosettex/numbers.py +51 -0
- rosettex-1.0.0/src/rosettex/pdf/__init__.py +6 -0
- rosettex-1.0.0/src/rosettex/pdf/classify.py +4340 -0
- rosettex-1.0.0/src/rosettex/pdf/extract.py +1762 -0
- rosettex-1.0.0/src/rosettex/pdf/merge.py +429 -0
- rosettex-1.0.0/src/rosettex/pdf/overlay.py +354 -0
- rosettex-1.0.0/src/rosettex/pdf/pipeline.py +586 -0
- rosettex-1.0.0/src/rosettex/pdf/reconcile.py +729 -0
- rosettex-1.0.0/src/rosettex/pdf/rxfit.lua +387 -0
- rosettex-1.0.0/src/rosettex/pdf/schema.py +356 -0
- rosettex-1.0.0/src/rosettex/pdf/snippets.py +1119 -0
- rosettex-1.0.0/src/rosettex/pdf/stream.py +1850 -0
- rosettex-1.0.0/src/rosettex/pdf/strip.py +565 -0
- rosettex-1.0.0/src/rosettex/postcheck.py +229 -0
- rosettex-1.0.0/src/rosettex/protocol/skill_head.md +23 -0
- rosettex-1.0.0/src/rosettex/segment.py +1219 -0
- rosettex-1.0.0/src/rosettex/skill.py +296 -0
- rosettex-1.0.0/src/rosettex/source.py +540 -0
- rosettex-1.0.0/src/rosettex/terms.py +269 -0
- rosettex-1.0.0/src/rosettex/texparse.py +221 -0
- rosettex-1.0.0/src/rosettex/textio.py +55 -0
- rosettex-1.0.0/src/rosettex/toolchain.py +424 -0
- rosettex-1.0.0/src/rosettex/unpack.py +205 -0
- rosettex-1.0.0/src/rosettex/workspace.py +413 -0
- rosettex-1.0.0/uv.lock +98 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rosettex",
|
|
3
|
+
"interface": {
|
|
4
|
+
"displayName": "rosettex"
|
|
5
|
+
},
|
|
6
|
+
"plugins": [
|
|
7
|
+
{
|
|
8
|
+
"name": "rosettex",
|
|
9
|
+
"source": {
|
|
10
|
+
"source": "local",
|
|
11
|
+
"path": "./"
|
|
12
|
+
},
|
|
13
|
+
"policy": {
|
|
14
|
+
"installation": "AVAILABLE",
|
|
15
|
+
"authentication": "ON_INSTALL"
|
|
16
|
+
},
|
|
17
|
+
"category": "Productivity"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rosettex",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Translate a scientific paper from its TeX source (folder, archive, arXiv ID) or a born-digital PDF into another language and rebuild the PDF with the paper's own layout. You translate; rosettex prepares, checks and typesets.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "20235106-huynk",
|
|
7
|
+
"url": "https://github.com/20235106-huynk"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/20235106-huynk/rosettex",
|
|
10
|
+
"repository": "https://github.com/20235106-huynk/rosettex",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"translation",
|
|
14
|
+
"latex",
|
|
15
|
+
"pdf",
|
|
16
|
+
"arxiv",
|
|
17
|
+
"scientific-papers",
|
|
18
|
+
"mcp"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rosettex",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "20235106-huynk"
|
|
5
|
+
},
|
|
6
|
+
"description": "Translate a scientific paper from its TeX source (folder, archive, arXiv ID) or a born-digital PDF into another language and rebuild the PDF with the paper's own layout. You translate; rosettex prepares, checks and typesets.",
|
|
7
|
+
"plugins": [
|
|
8
|
+
{
|
|
9
|
+
"name": "rosettex",
|
|
10
|
+
"source": "./",
|
|
11
|
+
"description": "Translate a scientific paper from its TeX source (folder, archive, arXiv ID) or a born-digital PDF into another language and rebuild the PDF with the paper's own layout. You translate; rosettex prepares, checks and typesets.",
|
|
12
|
+
"version": "1.0.0"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rosettex",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Translate a scientific paper from its TeX source (folder, archive, arXiv ID) or a born-digital PDF into another language and rebuild the PDF with the paper's own layout. You translate; rosettex prepares, checks and typesets.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "20235106-huynk",
|
|
7
|
+
"url": "https://github.com/20235106-huynk"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/20235106-huynk/rosettex",
|
|
10
|
+
"repository": "https://github.com/20235106-huynk/rosettex",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"translation",
|
|
14
|
+
"latex",
|
|
15
|
+
"pdf",
|
|
16
|
+
"arxiv",
|
|
17
|
+
"scientific-papers",
|
|
18
|
+
"mcp"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ci-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
# arXiv is hit once per workflow run (and not at all on a cache hit); the matrix gets the sources as an artifact.
|
|
17
|
+
fixtures:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
timeout-minutes: 15
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v5
|
|
22
|
+
- uses: astral-sh/setup-uv@v6
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.12"
|
|
25
|
+
- uses: actions/cache@v4
|
|
26
|
+
with:
|
|
27
|
+
path: .ci/work/corpus
|
|
28
|
+
key: arxiv-fixtures-${{ hashFiles('scripts/ci_smoke.py') }}
|
|
29
|
+
- run: uv sync
|
|
30
|
+
- run: uv run python scripts/ci_smoke.py --root .ci/work --fetch-only
|
|
31
|
+
- uses: actions/upload-artifact@v4
|
|
32
|
+
with:
|
|
33
|
+
name: fixtures
|
|
34
|
+
path: .ci/work/corpus
|
|
35
|
+
retention-days: 3
|
|
36
|
+
|
|
37
|
+
test:
|
|
38
|
+
needs: fixtures
|
|
39
|
+
strategy:
|
|
40
|
+
fail-fast: false
|
|
41
|
+
matrix:
|
|
42
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
43
|
+
python: ["3.11", "3.12"]
|
|
44
|
+
runs-on: ${{ matrix.os }}
|
|
45
|
+
timeout-minutes: 90
|
|
46
|
+
env:
|
|
47
|
+
ROSETTEX_HOME: ${{ github.workspace }}/.ci/home
|
|
48
|
+
PYTHONUTF8: "1"
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v5
|
|
51
|
+
- uses: astral-sh/setup-uv@v6
|
|
52
|
+
with:
|
|
53
|
+
python-version: ${{ matrix.python }}
|
|
54
|
+
- run: uv sync
|
|
55
|
+
- run: uv run ruff check .
|
|
56
|
+
- uses: actions/download-artifact@v4
|
|
57
|
+
with:
|
|
58
|
+
name: fixtures
|
|
59
|
+
path: .ci/work/corpus
|
|
60
|
+
# Private TinyTeX (~2 GB, ~9 min cold on Linux) per OS; the Python versions share it. A stale key restores the
|
|
61
|
+
# previous home and `setup` installs only what is missing.
|
|
62
|
+
- uses: actions/cache@v4
|
|
63
|
+
with:
|
|
64
|
+
path: .ci/home
|
|
65
|
+
key: rosettex-home-${{ runner.os }}-${{ hashFiles('src/rosettex/toolchain.py') }}
|
|
66
|
+
restore-keys: rosettex-home-${{ runner.os }}-
|
|
67
|
+
- run: uv run rosettex setup --yes --json
|
|
68
|
+
- run: uv run rosettex doctor --json
|
|
69
|
+
# Round-trip gate on the fixtures, then fetch โ prepare โ pseudo โ check โ build --no-agent, 2 papers ร vi/ar/ja.
|
|
70
|
+
- run: uv run python scripts/ci_smoke.py --root .ci/work
|
|
71
|
+
- if: always()
|
|
72
|
+
uses: actions/upload-artifact@v4
|
|
73
|
+
with:
|
|
74
|
+
name: smoke-${{ matrix.os }}-py${{ matrix.python }}
|
|
75
|
+
path: |
|
|
76
|
+
.ci/work/summary.json
|
|
77
|
+
.ci/work/work/*/*.pdf
|
|
78
|
+
.ci/work/work/*/build/*.log
|
|
79
|
+
if-no-files-found: ignore
|
|
80
|
+
retention-days: 7
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
# Push a tag vX.Y.Z (matching pyproject.toml) to build and publish to PyPI. Needs a PyPI trusted publisher for this
|
|
4
|
+
# repository: workflow release.yml, environment pypi.
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
tags: ["v*"]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v5
|
|
17
|
+
- uses: astral-sh/setup-uv@v6
|
|
18
|
+
- name: Tag matches the package version
|
|
19
|
+
run: test "v$(uv run python -c 'import rosettex; print(rosettex.__version__)')" = "$GITHUB_REF_NAME"
|
|
20
|
+
- run: uv run python -m rosettex.skill --check
|
|
21
|
+
- run: uv build
|
|
22
|
+
- uses: actions/upload-artifact@v4
|
|
23
|
+
with:
|
|
24
|
+
name: dist
|
|
25
|
+
path: dist/
|
|
26
|
+
|
|
27
|
+
publish:
|
|
28
|
+
needs: build
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
environment: pypi
|
|
31
|
+
permissions:
|
|
32
|
+
id-token: write
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/download-artifact@v4
|
|
35
|
+
with:
|
|
36
|
+
name: dist
|
|
37
|
+
path: dist/
|
|
38
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Python / tooling
|
|
2
|
+
__pycache__/
|
|
3
|
+
.venv/
|
|
4
|
+
.ruff_cache/
|
|
5
|
+
*.egg-info/
|
|
6
|
+
dist/
|
|
7
|
+
build/
|
|
8
|
+
.ci/
|
|
9
|
+
|
|
10
|
+
# Development-only content: never published
|
|
11
|
+
docs/
|
|
12
|
+
spike/
|
|
13
|
+
dev/
|
|
14
|
+
.claude/
|
|
15
|
+
.orca/
|
|
16
|
+
CLAUDE.md
|
|
17
|
+
AGENTS.md
|
|
18
|
+
GEMINI.md
|
|
19
|
+
# Only the CI scripts are published
|
|
20
|
+
scripts/*
|
|
21
|
+
!scripts/ci_smoke.py
|
|
22
|
+
!scripts/pseudo_translate.py
|
|
23
|
+
!scripts/roundtrip_gate.py
|
rosettex-1.0.0/.mcp.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.0 โ 2026-11-27
|
|
4
|
+
Complete redesign (replaces the 0.x MinerU-based tool): input is the paper's TeX source or a born-digital PDF.
|
|
5
|
+
- TeX route: fetch from a folder, archive or arXiv, segment the source into question sheets, check translations
|
|
6
|
+
(placeholders, numbers, terms, untranslated text), rebuild with LuaLaTeX, agent repair loop.
|
|
7
|
+
- PDF route for born-digital PDFs: keeps the original pages, strips and replaces the translated text in its boxes,
|
|
8
|
+
inline formulas as vector snippets, links relocated, per-segment character budgets, agent repair rounds for
|
|
9
|
+
overflowing text, formulas missed by detection corrected from the agent's verbatim copies.
|
|
10
|
+
- Bundled fonts for non-Latin scripts (Noto, Vazirmatn for Arabic/Persian/Urdu); copy/search-friendly output for
|
|
11
|
+
Indic and Thai scripts.
|
|
12
|
+
- CLI with `--json` envelopes, MCP server (`rosettex-mcp`), skill and plugin bundles for Claude Code, Gemini CLI and
|
|
13
|
+
Antigravity.
|
rosettex-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nguyแป
n Kim Huy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
Bundled fonts (src/rosettex/data/fonts/) are distributed under the SIL Open Font
|
|
25
|
+
License 1.1; each font's licence text is in src/rosettex/data/fonts/LICENSES/.
|
rosettex-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: rosettex
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Translate scientific papers (TeX source or born-digital PDF) into another language with the original layout, for AI agent harnesses
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: agents,latex,mcp,pdf,scientific-papers,translation
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Requires-Dist: pylatexenc==2.10
|
|
10
|
+
Requires-Dist: pypdf<8,>=7.2
|
|
11
|
+
Requires-Dist: pypdfium2<6,>=5.15
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
<!-- mcp-name: io.github.20235106-huynk/rosettex -->
|
|
15
|
+
<div align="center">
|
|
16
|
+
|
|
17
|
+
# rosettex ๐โจ
|
|
18
|
+
|
|
19
|
+
**Translate scientific papers into 19+ languages โ and keep the paper's own layout.**
|
|
20
|
+
|
|
21
|
+
[](https://github.com/20235106-huynk/rosettex/blob/main/pyproject.toml)
|
|
22
|
+
[](#-two-routes)
|
|
23
|
+
[](#-requirements)
|
|
24
|
+
[](#-connect-your-agent)
|
|
25
|
+
[](https://github.com/20235106-huynk/rosettex/blob/main/LICENSE)
|
|
26
|
+
|
|
27
|
+
[Quick Install](#-quick-install-let-your-agent-do-it) โข [Features](#-key-features) โข [How It Works](#-how-it-works) โข [Usage](#-usage) โข [Languages](#-languages) โข [Manual Install](#-manual-install)
|
|
28
|
+
|
|
29
|
+
<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">
|
|
30
|
+
|
|
31
|
+
<sub>A born-digital PDF (left) and rosettex's Vietnamese output (right): same page, same figure, same fonts for names and
|
|
32
|
+
formulas. Paper: Berestov et al., CEUR-WS Vol-3550 (CC BY 4.0).</sub>
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
`rosettex` is a tool for **AI coding agents** ([Claude Code](https://claude.ai/code), [Gemini CLI](https://github.com/google-gemini/gemini-cli),
|
|
39
|
+
Antigravity, or any MCP client) that translates whole scientific papers.
|
|
40
|
+
|
|
41
|
+
**rosettex does not translate by itself โ your agent is the translator.** rosettex does the engineering around it:
|
|
42
|
+
it splits the paper into question sheets with protected placeholders, checks every answer against strict rules, and
|
|
43
|
+
typesets the result so formulas, figures, citations and links stay real, selectable and clickable.
|
|
44
|
+
|
|
45
|
+
## ๐ Key Features
|
|
46
|
+
|
|
47
|
+
| Feature | Description |
|
|
48
|
+
|---|---|
|
|
49
|
+
| ๐ค **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. |
|
|
50
|
+
| ๐ **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. |
|
|
51
|
+
| ๐งฎ **Formulas stay formulas** | Inline and display math, citations and links become placeholders (`โฆm1โง`, `โฆl2โง`) the translation must keep; on PDFs they are copied as vector snippets of the original. |
|
|
52
|
+
| ๐ก๏ธ **Strict checks** | `rosettex check` catches lost placeholders, changed numbers, glossary violations, untranslated text and over-long answers before anything is built. |
|
|
53
|
+
| ๐ **Repair loop** | When text does not fit, `build` answers `needs_repair` with the segments to shorten and by how much; nothing is silently cut. |
|
|
54
|
+
| ๐ **Many scripts** | Latin, Cyrillic, CJK, Arabic/Persian/Urdu, Devanagari, Bengali, Tamil, Thai, Myanmar, Ethiopic โฆ with bundled fonts (Noto, Vazirmatn) and copy/search-friendly output. |
|
|
55
|
+
|
|
56
|
+
## ๐ Two Routes
|
|
57
|
+
|
|
58
|
+
| | From TeX source | From a born-digital PDF |
|
|
59
|
+
|---|---|---|
|
|
60
|
+
| **Input** | folder, archive, arXiv ID or link | a PDF with a text layer (journals, arXiv PDF-only, Word exports) |
|
|
61
|
+
| **Output** | the paper recompiled with LuaLaTeX in the target language | the original pages with translated text in the same boxes |
|
|
62
|
+
| **Best for** | any paper with source; changes of writing direction (e.g. English โ Arabic) | papers without source |
|
|
63
|
+
|
|
64
|
+
## ๐ How It Works
|
|
65
|
+
|
|
66
|
+
```mermaid
|
|
67
|
+
flowchart LR
|
|
68
|
+
A[๐ TeX source<br/>or PDF] --> B[๐งฉ rosettex prepare<br/>sheets + placeholders]
|
|
69
|
+
B --> C[๐ค Your agent<br/>translates]
|
|
70
|
+
C --> D[๐ก๏ธ rosettex check<br/>placeholders ยท numbers ยท terms]
|
|
71
|
+
D --> E[๐๏ธ rosettex build<br/>LuaLaTeX]
|
|
72
|
+
E -->|needs_repair| C
|
|
73
|
+
E --> F[๐ Translated PDF]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
rosettex fetch 2108.07760 -o work # folder, archive, arXiv ID/link, or a local .pdf
|
|
78
|
+
rosettex prepare work --lang vi # question sheets in work/read/, glossary in work/terms.md
|
|
79
|
+
# โฆ the agent appends "sNNNN <translation>" lines to work/out/NN.txt โฆ
|
|
80
|
+
rosettex check work # repeat until ok
|
|
81
|
+
rosettex build work --out paper.vi.pdf # may ask for shorter text (needs_repair), then build again
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## ๐ Quick Install: Let Your Agent Do It
|
|
85
|
+
|
|
86
|
+
> [!TIP]
|
|
87
|
+
> Copy the prompt below and send it to your coding agent. It installs everything into your home folder and asks before
|
|
88
|
+
> any download.
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
Install the tool "rosettex" on this computer and connect it to yourself, so that later I can ask you to translate
|
|
92
|
+
scientific papers. Source: https://github.com/20235106-huynk/rosettex
|
|
93
|
+
|
|
94
|
+
Rules: never use sudo; install only into my home folder (~/.rosettex, the folder where uv puts tools, and the skill
|
|
95
|
+
folders written by "rosettex install-skill"); ask me before running a remote installer or editing my shell profile;
|
|
96
|
+
run one command at a time and show me any error.
|
|
97
|
+
|
|
98
|
+
1. uv: run "uv --version". If missing, ask me, then install it with the official installer
|
|
99
|
+
(the commands are on https://docs.astral.sh/uv/getting-started/installation/).
|
|
100
|
+
2. rosettex: run "uv tool install git+https://github.com/20235106-huynk/rosettex", then "rosettex --help".
|
|
101
|
+
If the command is not found, use the path from "uv tool dir --bin".
|
|
102
|
+
3. TeX: run "rosettex setup --json". If it asks (ask_user), ask me exactly that question; on yes run its next_argv and
|
|
103
|
+
keep running next_argv while state is "partial". If I prefer my own TeX Live, run "rosettex setup --tex system --json".
|
|
104
|
+
4. Run "rosettex doctor --json" and tell me the result.
|
|
105
|
+
5. Run "rosettex install-skill --json" so you know when and how to use rosettex.
|
|
106
|
+
6. Report what you installed and give me an example request, such as:
|
|
107
|
+
"Translate the paper ~/papers/attention.pdf into Vietnamese and save it in ~/translated/".
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## ๐ Usage
|
|
111
|
+
|
|
112
|
+
Ask your agent in plain language:
|
|
113
|
+
|
|
114
|
+
```text
|
|
115
|
+
Translate arXiv 1512.03385 into Simplified Chinese and save it as ~/papers/resnet.zh.pdf
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The agent fetches the paper, picks the field and key terms, translates sheet by sheet, runs `check` until it passes,
|
|
119
|
+
builds the PDF, shortens any text `build` reports as too long, and tells you where the PDF is and what to look at.
|
|
120
|
+
|
|
121
|
+
## ๐ Connect Your Agent
|
|
122
|
+
|
|
123
|
+
This repository is a plugin at its root: one skill (`skills/rosettex`) and one MCP server (`uvx` runs `rosettex-mcp` from
|
|
124
|
+
the tagged release), so you need [uv](https://docs.astral.sh/uv/) on PATH. Install it into your harness with its own command:
|
|
125
|
+
|
|
126
|
+
| Harness | Command |
|
|
127
|
+
|---|---|
|
|
128
|
+
| **Claude Code** | `/plugin marketplace add 20235106-huynk/rosettex`, then `/plugin install rosettex@rosettex` |
|
|
129
|
+
| **Codex CLI** | `codex plugin marketplace add 20235106-huynk/rosettex --ref v1.0.0`, then install `rosettex` from the Plugins tab |
|
|
130
|
+
| **GitHub Copilot CLI** | `copilot plugin install 20235106-huynk/rosettex` |
|
|
131
|
+
| **VS Code (Copilot)** | "Chat: Install Plugin from Source", then the repository URL |
|
|
132
|
+
| **Antigravity** | `agy plugin install https://github.com/20235106-huynk/rosettex` |
|
|
133
|
+
| **Gemini CLI** | `gemini extensions install https://github.com/20235106-huynk/rosettex --ref v1.0.0` |
|
|
134
|
+
| **Hermes** | `hermes plugins install 20235106-huynk/rosettex/plugins/hermes`, then `hermes plugins enable rosettex` (the slim package: Hermes rejects the full repository) |
|
|
135
|
+
| **Factory Droid, Auggie, Junie, Qwen Code, Devin, Kiro, goose** | their plugin or extension command on the repository URL (they read the Claude Code or Agent Plugins files) |
|
|
136
|
+
| **Any harness with Agent Skills** | `rosettex install-skill` (writes `~/.agents/skills`, `~/.claude/skills`, `~/.gemini/config/skills`, and `~/.cline`, `~/.kiro`, `~/.qoder`, `~/.trae`, `~/.codebuddy` skills when those folders exist) |
|
|
137
|
+
| **Any MCP client** | a stdio server: `uvx --from git+https://github.com/20235106-huynk/rosettex@v1.0.0 rosettex-mcp` (or `rosettex-mcp` after `uv tool install`) |
|
|
138
|
+
| **Anything else** | tell the agent: *"Run `rosettex guide` and follow it."* |
|
|
139
|
+
|
|
140
|
+
Claude Code, in one step: `/plugin install rosettex --marketplace 20235106-huynk/rosettex`. Harnesses that accept only
|
|
141
|
+
remote MCP servers (Android Studio, Replit, ChatGPT custom MCP) cannot run the stdio server; use the skill and the CLI.
|
|
142
|
+
The manifests are generated from the package version: `uv run python -m rosettex.skill` (`--check` in CI).
|
|
143
|
+
|
|
144
|
+
To try the server from a checkout, `plugins/mcp.dev.json` runs it with `uv run --project .`.
|
|
145
|
+
|
|
146
|
+
## ๐ ๏ธ Manual Install
|
|
147
|
+
|
|
148
|
+
<details>
|
|
149
|
+
<summary><b>Commands, requirements and environment variables</b></summary>
|
|
150
|
+
|
|
151
|
+
### Requirements
|
|
152
|
+
- Python โฅ 3.11 and [uv](https://docs.astral.sh/uv/).
|
|
153
|
+
- LuaLaTeX: `rosettex setup` installs a private TinyTeX into `~/.rosettex` (asks first), or
|
|
154
|
+
`rosettex setup --tex system` uses an existing TeX Live.
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
uv tool install git+https://github.com/20235106-huynk/rosettex
|
|
158
|
+
rosettex setup # or: rosettex setup --tex system
|
|
159
|
+
rosettex doctor
|
|
160
|
+
rosettex install-skill
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Environment variables
|
|
164
|
+
- `ROSETTEX_HOME`: where rosettex keeps its TeX toolchain and state (default `~/.rosettex`).
|
|
165
|
+
|
|
166
|
+
### Update and uninstall
|
|
167
|
+
```bash
|
|
168
|
+
uv tool upgrade rosettex && rosettex install-skill --force
|
|
169
|
+
rosettex install-skill --remove && uv tool uninstall rosettex # then delete the folder ~/.rosettex
|
|
170
|
+
```
|
|
171
|
+
</details>
|
|
172
|
+
|
|
173
|
+
## ๐ Languages
|
|
174
|
+
|
|
175
|
+
Language data covers about 50 target languages (`src/rosettex/data/langs/`). Tested end to end:
|
|
176
|
+
|
|
177
|
+
| Script | Languages |
|
|
178
|
+
|---|---|
|
|
179
|
+
| **Latin** | Vietnamese, French |
|
|
180
|
+
| **Cyrillic** | Russian |
|
|
181
|
+
| **Han / Kana / Hangul** | Chinese (Simplified, Traditional), Japanese, Korean |
|
|
182
|
+
| **Arabic** (RTL) | Arabic, Persian, Urdu |
|
|
183
|
+
| **Indic** | Hindi, Bengali, Gujarati, Kannada, Tamil, Telugu |
|
|
184
|
+
| **Southeast Asian** | Thai, Myanmar |
|
|
185
|
+
| **Ethiopic** | Amharic |
|
|
186
|
+
|
|
187
|
+
## โ ๏ธ Limits
|
|
188
|
+
|
|
189
|
+
- The PDF route needs a born-digital PDF with a text layer (no OCR) and keeps the writing direction: a left-to-right
|
|
190
|
+
paper cannot become right-to-left there โ use the TeX source for that.
|
|
191
|
+
- Table contents are not translated; scanned PDFs, vertical writing and PDF forms are not supported.
|
|
192
|
+
- Very tight layouts may need shorter translations (`needs_repair`) or a slightly smaller font.
|
|
193
|
+
|
|
194
|
+
## ๐ License
|
|
195
|
+
|
|
196
|
+
MIT โ see [`LICENSE`](https://github.com/20235106-huynk/rosettex/blob/main/LICENSE). Bundled fonts are under the SIL Open Font License 1.1
|
|
197
|
+
(`src/rosettex/data/fonts/LICENSES/`).
|
rosettex-1.0.0/README.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<!-- mcp-name: io.github.20235106-huynk/rosettex -->
|
|
2
|
+
<div align="center">
|
|
3
|
+
|
|
4
|
+
# rosettex ๐โจ
|
|
5
|
+
|
|
6
|
+
**Translate scientific papers into 19+ languages โ and keep the paper's own layout.**
|
|
7
|
+
|
|
8
|
+
[](https://github.com/20235106-huynk/rosettex/blob/main/pyproject.toml)
|
|
9
|
+
[](#-two-routes)
|
|
10
|
+
[](#-requirements)
|
|
11
|
+
[](#-connect-your-agent)
|
|
12
|
+
[](https://github.com/20235106-huynk/rosettex/blob/main/LICENSE)
|
|
13
|
+
|
|
14
|
+
[Quick Install](#-quick-install-let-your-agent-do-it) โข [Features](#-key-features) โข [How It Works](#-how-it-works) โข [Usage](#-usage) โข [Languages](#-languages) โข [Manual Install](#-manual-install)
|
|
15
|
+
|
|
16
|
+
<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">
|
|
17
|
+
|
|
18
|
+
<sub>A born-digital PDF (left) and rosettex's Vietnamese output (right): same page, same figure, same fonts for names and
|
|
19
|
+
formulas. Paper: Berestov et al., CEUR-WS Vol-3550 (CC BY 4.0).</sub>
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
`rosettex` is a tool for **AI coding agents** ([Claude Code](https://claude.ai/code), [Gemini CLI](https://github.com/google-gemini/gemini-cli),
|
|
26
|
+
Antigravity, or any MCP client) that translates whole scientific papers.
|
|
27
|
+
|
|
28
|
+
**rosettex does not translate by itself โ your agent is the translator.** rosettex does the engineering around it:
|
|
29
|
+
it splits the paper into question sheets with protected placeholders, checks every answer against strict rules, and
|
|
30
|
+
typesets the result so formulas, figures, citations and links stay real, selectable and clickable.
|
|
31
|
+
|
|
32
|
+
## ๐ Key Features
|
|
33
|
+
|
|
34
|
+
| Feature | Description |
|
|
35
|
+
|---|---|
|
|
36
|
+
| ๐ค **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. |
|
|
37
|
+
| ๐ **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. |
|
|
38
|
+
| ๐งฎ **Formulas stay formulas** | Inline and display math, citations and links become placeholders (`โฆm1โง`, `โฆl2โง`) the translation must keep; on PDFs they are copied as vector snippets of the original. |
|
|
39
|
+
| ๐ก๏ธ **Strict checks** | `rosettex check` catches lost placeholders, changed numbers, glossary violations, untranslated text and over-long answers before anything is built. |
|
|
40
|
+
| ๐ **Repair loop** | When text does not fit, `build` answers `needs_repair` with the segments to shorten and by how much; nothing is silently cut. |
|
|
41
|
+
| ๐ **Many scripts** | Latin, Cyrillic, CJK, Arabic/Persian/Urdu, Devanagari, Bengali, Tamil, Thai, Myanmar, Ethiopic โฆ with bundled fonts (Noto, Vazirmatn) and copy/search-friendly output. |
|
|
42
|
+
|
|
43
|
+
## ๐ Two Routes
|
|
44
|
+
|
|
45
|
+
| | From TeX source | From a born-digital PDF |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| **Input** | folder, archive, arXiv ID or link | a PDF with a text layer (journals, arXiv PDF-only, Word exports) |
|
|
48
|
+
| **Output** | the paper recompiled with LuaLaTeX in the target language | the original pages with translated text in the same boxes |
|
|
49
|
+
| **Best for** | any paper with source; changes of writing direction (e.g. English โ Arabic) | papers without source |
|
|
50
|
+
|
|
51
|
+
## ๐ How It Works
|
|
52
|
+
|
|
53
|
+
```mermaid
|
|
54
|
+
flowchart LR
|
|
55
|
+
A[๐ TeX source<br/>or PDF] --> B[๐งฉ rosettex prepare<br/>sheets + placeholders]
|
|
56
|
+
B --> C[๐ค Your agent<br/>translates]
|
|
57
|
+
C --> D[๐ก๏ธ rosettex check<br/>placeholders ยท numbers ยท terms]
|
|
58
|
+
D --> E[๐๏ธ rosettex build<br/>LuaLaTeX]
|
|
59
|
+
E -->|needs_repair| C
|
|
60
|
+
E --> F[๐ Translated PDF]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
rosettex fetch 2108.07760 -o work # folder, archive, arXiv ID/link, or a local .pdf
|
|
65
|
+
rosettex prepare work --lang vi # question sheets in work/read/, glossary in work/terms.md
|
|
66
|
+
# โฆ the agent appends "sNNNN <translation>" lines to work/out/NN.txt โฆ
|
|
67
|
+
rosettex check work # repeat until ok
|
|
68
|
+
rosettex build work --out paper.vi.pdf # may ask for shorter text (needs_repair), then build again
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## ๐ Quick Install: Let Your Agent Do It
|
|
72
|
+
|
|
73
|
+
> [!TIP]
|
|
74
|
+
> Copy the prompt below and send it to your coding agent. It installs everything into your home folder and asks before
|
|
75
|
+
> any download.
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
Install the tool "rosettex" on this computer and connect it to yourself, so that later I can ask you to translate
|
|
79
|
+
scientific papers. Source: https://github.com/20235106-huynk/rosettex
|
|
80
|
+
|
|
81
|
+
Rules: never use sudo; install only into my home folder (~/.rosettex, the folder where uv puts tools, and the skill
|
|
82
|
+
folders written by "rosettex install-skill"); ask me before running a remote installer or editing my shell profile;
|
|
83
|
+
run one command at a time and show me any error.
|
|
84
|
+
|
|
85
|
+
1. uv: run "uv --version". If missing, ask me, then install it with the official installer
|
|
86
|
+
(the commands are on https://docs.astral.sh/uv/getting-started/installation/).
|
|
87
|
+
2. rosettex: run "uv tool install git+https://github.com/20235106-huynk/rosettex", then "rosettex --help".
|
|
88
|
+
If the command is not found, use the path from "uv tool dir --bin".
|
|
89
|
+
3. TeX: run "rosettex setup --json". If it asks (ask_user), ask me exactly that question; on yes run its next_argv and
|
|
90
|
+
keep running next_argv while state is "partial". If I prefer my own TeX Live, run "rosettex setup --tex system --json".
|
|
91
|
+
4. Run "rosettex doctor --json" and tell me the result.
|
|
92
|
+
5. Run "rosettex install-skill --json" so you know when and how to use rosettex.
|
|
93
|
+
6. Report what you installed and give me an example request, such as:
|
|
94
|
+
"Translate the paper ~/papers/attention.pdf into Vietnamese and save it in ~/translated/".
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## ๐ Usage
|
|
98
|
+
|
|
99
|
+
Ask your agent in plain language:
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
Translate arXiv 1512.03385 into Simplified Chinese and save it as ~/papers/resnet.zh.pdf
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The agent fetches the paper, picks the field and key terms, translates sheet by sheet, runs `check` until it passes,
|
|
106
|
+
builds the PDF, shortens any text `build` reports as too long, and tells you where the PDF is and what to look at.
|
|
107
|
+
|
|
108
|
+
## ๐ Connect Your Agent
|
|
109
|
+
|
|
110
|
+
This repository is a plugin at its root: one skill (`skills/rosettex`) and one MCP server (`uvx` runs `rosettex-mcp` from
|
|
111
|
+
the tagged release), so you need [uv](https://docs.astral.sh/uv/) on PATH. Install it into your harness with its own command:
|
|
112
|
+
|
|
113
|
+
| Harness | Command |
|
|
114
|
+
|---|---|
|
|
115
|
+
| **Claude Code** | `/plugin marketplace add 20235106-huynk/rosettex`, then `/plugin install rosettex@rosettex` |
|
|
116
|
+
| **Codex CLI** | `codex plugin marketplace add 20235106-huynk/rosettex --ref v1.0.0`, then install `rosettex` from the Plugins tab |
|
|
117
|
+
| **GitHub Copilot CLI** | `copilot plugin install 20235106-huynk/rosettex` |
|
|
118
|
+
| **VS Code (Copilot)** | "Chat: Install Plugin from Source", then the repository URL |
|
|
119
|
+
| **Antigravity** | `agy plugin install https://github.com/20235106-huynk/rosettex` |
|
|
120
|
+
| **Gemini CLI** | `gemini extensions install https://github.com/20235106-huynk/rosettex --ref v1.0.0` |
|
|
121
|
+
| **Hermes** | `hermes plugins install 20235106-huynk/rosettex/plugins/hermes`, then `hermes plugins enable rosettex` (the slim package: Hermes rejects the full repository) |
|
|
122
|
+
| **Factory Droid, Auggie, Junie, Qwen Code, Devin, Kiro, goose** | their plugin or extension command on the repository URL (they read the Claude Code or Agent Plugins files) |
|
|
123
|
+
| **Any harness with Agent Skills** | `rosettex install-skill` (writes `~/.agents/skills`, `~/.claude/skills`, `~/.gemini/config/skills`, and `~/.cline`, `~/.kiro`, `~/.qoder`, `~/.trae`, `~/.codebuddy` skills when those folders exist) |
|
|
124
|
+
| **Any MCP client** | a stdio server: `uvx --from git+https://github.com/20235106-huynk/rosettex@v1.0.0 rosettex-mcp` (or `rosettex-mcp` after `uv tool install`) |
|
|
125
|
+
| **Anything else** | tell the agent: *"Run `rosettex guide` and follow it."* |
|
|
126
|
+
|
|
127
|
+
Claude Code, in one step: `/plugin install rosettex --marketplace 20235106-huynk/rosettex`. Harnesses that accept only
|
|
128
|
+
remote MCP servers (Android Studio, Replit, ChatGPT custom MCP) cannot run the stdio server; use the skill and the CLI.
|
|
129
|
+
The manifests are generated from the package version: `uv run python -m rosettex.skill` (`--check` in CI).
|
|
130
|
+
|
|
131
|
+
To try the server from a checkout, `plugins/mcp.dev.json` runs it with `uv run --project .`.
|
|
132
|
+
|
|
133
|
+
## ๐ ๏ธ Manual Install
|
|
134
|
+
|
|
135
|
+
<details>
|
|
136
|
+
<summary><b>Commands, requirements and environment variables</b></summary>
|
|
137
|
+
|
|
138
|
+
### Requirements
|
|
139
|
+
- Python โฅ 3.11 and [uv](https://docs.astral.sh/uv/).
|
|
140
|
+
- LuaLaTeX: `rosettex setup` installs a private TinyTeX into `~/.rosettex` (asks first), or
|
|
141
|
+
`rosettex setup --tex system` uses an existing TeX Live.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
uv tool install git+https://github.com/20235106-huynk/rosettex
|
|
145
|
+
rosettex setup # or: rosettex setup --tex system
|
|
146
|
+
rosettex doctor
|
|
147
|
+
rosettex install-skill
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Environment variables
|
|
151
|
+
- `ROSETTEX_HOME`: where rosettex keeps its TeX toolchain and state (default `~/.rosettex`).
|
|
152
|
+
|
|
153
|
+
### Update and uninstall
|
|
154
|
+
```bash
|
|
155
|
+
uv tool upgrade rosettex && rosettex install-skill --force
|
|
156
|
+
rosettex install-skill --remove && uv tool uninstall rosettex # then delete the folder ~/.rosettex
|
|
157
|
+
```
|
|
158
|
+
</details>
|
|
159
|
+
|
|
160
|
+
## ๐ Languages
|
|
161
|
+
|
|
162
|
+
Language data covers about 50 target languages (`src/rosettex/data/langs/`). Tested end to end:
|
|
163
|
+
|
|
164
|
+
| Script | Languages |
|
|
165
|
+
|---|---|
|
|
166
|
+
| **Latin** | Vietnamese, French |
|
|
167
|
+
| **Cyrillic** | Russian |
|
|
168
|
+
| **Han / Kana / Hangul** | Chinese (Simplified, Traditional), Japanese, Korean |
|
|
169
|
+
| **Arabic** (RTL) | Arabic, Persian, Urdu |
|
|
170
|
+
| **Indic** | Hindi, Bengali, Gujarati, Kannada, Tamil, Telugu |
|
|
171
|
+
| **Southeast Asian** | Thai, Myanmar |
|
|
172
|
+
| **Ethiopic** | Amharic |
|
|
173
|
+
|
|
174
|
+
## โ ๏ธ Limits
|
|
175
|
+
|
|
176
|
+
- The PDF route needs a born-digital PDF with a text layer (no OCR) and keeps the writing direction: a left-to-right
|
|
177
|
+
paper cannot become right-to-left there โ use the TeX source for that.
|
|
178
|
+
- Table contents are not translated; scanned PDFs, vertical writing and PDF forms are not supported.
|
|
179
|
+
- Very tight layouts may need shorter translations (`needs_repair`) or a slightly smaller font.
|
|
180
|
+
|
|
181
|
+
## ๐ License
|
|
182
|
+
|
|
183
|
+
MIT โ see [`LICENSE`](https://github.com/20235106-huynk/rosettex/blob/main/LICENSE). Bundled fonts are under the SIL Open Font License 1.1
|
|
184
|
+
(`src/rosettex/data/fonts/LICENSES/`).
|