Skip to content
Agentmart
Submit a tool

do.arxiv-translator

Automatically downloads LaTeX source from arXiv, translates it to a target language (default Chinese), and compiles it to PDF using xelatex.

Skill by dull-bird

IndexedMIT★ 7
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/dull-bird-do-arxiv-translator

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Automatically downloads LaTeX source from arXiv, translates it to a target language (default Chinese), and compiles it to PDF using xelatex. Uses modern xeCJK for multilingual support. Trigger when the user provides an arXiv URL, paper ID, or natural language query about an arXiv paper and wants it translated/compiled.

Use cases: documents, research

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/do-arxiv-translator

What's inside

Skill name
do.arxiv-translator
Description
Automatically downloads LaTeX source from arXiv, translates it to a target language (default Chinese), and compiles it to PDF using xelatex. Uses modern xeCJK for multilingual support. Trigger when the user provides an arXiv URL, paper ID, or natural language query about an arXiv paper and wants it translated/compiled.
License
MIT
Instructions
85 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts
  • Instructions call the network

Agent Skills spec issues

  • name: only lowercase letters, digits and single hyphens allowed

Files (2)

  • SKILL.md
  • split_tex.py · scripts/

SKILL.md (first lines)

# arXiv LaTeX Translator & Compiler (Modern Solution)

This skill handles the end-to-end workflow of converting an arXiv paper's LaTeX source into a translated PDF on Windows, macOS, and Linux using modern `xeCJK` and `fontspec`.

## Workflow

### 0. Pre-flight Dependency Check
Before starting, verify that all required system tools are installed.
- **Windows (PowerShell):** `Get-Command curl, tar, xelatex, bibtex -ErrorAction SilentlyContinue`
- **macOS / Linux (Bash):** `for cmd in curl tar xelatex bibtex; do command -v $cmd >/dev/null 2>&1 || echo "Missing: $cmd"; done`

### 1. Identify & Download
- Extract the ID (e.g., `2508.11825v2`) from the URL or find it via search.
- Create a target directory and download/extract the source and the paper pdf (for final check) using native tools (`curl`, `tar`).
  - Abstract: `https://arxiv.org/abs/xxxx.xxxxx`
  - Source: `https://arxiv.org/src/xxxx.xxxxx`
  - PDF: `https://arxiv.org/pdf/xxxx.xxxxx.pdf`

### 2. Analyze & Modularize (For Large Papers)
- Read the original `.pdf` file to build a mental map.
- **Modularization Strategy (Crucial for Reliability):**
    - If the main `.tex` file is large (>500 lines), **DO NOT use the `replace` tool for content translation.** It is prone to whitespace/encoding mismatches.
    - Instead, run the bundled splitter to split the monolithic `.tex` file into sub-files by `\section` (e.g. `sections/01_intro.tex`, `sections/02_related.tex`) and rewrite the main file to use `\input{sections/xxx.tex}`:
      ```bash
      python3 <skill-dir>/scripts/split_tex.py main.tex --cjk-font "Noto Sans CJK SC"
      ```
      Pick the platform CJK font first (Windows: `Microsoft YaHei`; macOS: `PingFang SC`; Linux: `Noto Sans CJK SC`). The script is idempotent, never overwrites existing section files, and prints a JSON report — verify `sections` before translating. Use `--dry-run` to preview.
    - For small files, you may still use `replace` or directly overwrite the file with `write_file`.
- **Terminology Glossary:** Create a local mental glossary of 5-10 core technical terms to ensure consistency.

### 3. Atomic Translation (Write-File Overwrite)
- **Work on Chunks:** Translate one sub-file (or one section) at a time.
- **Overwrite Mode:** Use the `write_file` tool to write the fully translated content into the sub-files. This avoids the "string not found" errors common with the `replace` tool.
- **Content Preservation:** Rigorously preserve LaTeX commands, math environments, citations, and references.
- **Modern Chinese Support (xeCJK)**:
    - Inject `\usepackage{xeCJK}` and `\setCJKmainfont{Microsoft YaHei}` (or platform equivalent) into the main preamble.

### 4. Compile & Auto-Fix
- Use `xelatex -interaction=nonstopmode`.
- **Standard compilation loop:** `xelatex` -> `bibtex` -> `xelatex` x2.
- **Missing Package Installation (First Priority):** If compilation fails with a `File 'xxx.sty' not found` or `LaTeX Error: File 'xxx.cls' not found` error, **ALWAYS attempt to install the missing package first** before modifying any source file:
    1. Run `tlmgr search --file xxx.sty` to identify the TeX Live package name.
    2. Run `tlmgr install <package-name>` (may require `sudo` on macOS/Linux).
    3. If `tlmgr` is not available or fails, try `mktexlsr` to refresh the package database.
    4. On macOS with MacTeX, you can also use `sudo tlmgr update --self && sudo tlmgr install <package-name>`.
    5. Only after exhausting all installation options should you consider workarounds in source code.
- **Other Error Auto-Fixing:** For non-package errors (e.g., undefined commands, syntax errors), read the `.log` file, identify the error line, and fix the corresponding sub-file using `write_file` or `replace`.

### 5. Integrity Verification & Archive
- **Completeness Check:** Verify all sub-files in `sections/` are translated.
- **Visual Check:** Compare the translated PDF with the original.
- **Standardized Archiving:** Move the final compiled PDF to the Obsidian vault at `60_Notes/papers/<Paper_Title>/<Paper_Title>_<LANG>.pdf` (e.g., `60_Notes/papers/Attention Is All You Need/Attention Is All You Need_CN.pdf`), aligning with `note-summary`'s structure.
- Clean up intermediate files in the working directory.

## Guidelines
- **Prefer `write_file` over `replace` for Translation**: Overwriting a small, dedicated section file is 100% reliable compared to searching for a literal string in a 20,000-line file.
- **Font Selection**:
    - Windows: `Microsoft YaHei` or `SimSun`.
    - macOS: `PingFang SC`.
    - Linux: `Noto Sans CJK SC`.
- **Preserve Template**: Use `xeCJK` to minimize style interference.
- **Heredocs**: Use single-quoted heredocs in shells to handle backslashes correctly.

## Rules

- Read `deeporbit.json` from the workspace root to determine the interaction language. Use this language for all your responses and generated note contents (e.g. `zh-CN`). **The Obsidian folder paths themselves will ALWAYS remain in English.**
- Set `author: ai` in frontmatter for every note you create; switch to `author: mixed` when substantially rewriting a human-authored note. Authorship lives in frontmatter only — never add visible badges.
- **Missing Package — Install First, Never Remove:** If `xelatex` (or `pdflatex`) reports a missing `.sty` or `.cls` file, you MUST attempt to install the package using `tlmgr` **before** considering any source-code modification. The goal is to preserve the original paper's formatting as faithfully as possible. Only if installation is truly impossible (e.g., proprietary journal class not on CTAN) may you apply minimal source-level workarounds, and you must document the reason.
    - **Install workflow:**
      ```bash
      # 1. Find the package name
      tlmgr search --file <missing-file.sty>
      # 2. Install it
      sudo tlmgr install <package-name>
      # 3. Refresh the filename database
      sudo mktexlsr
      ```
    - Common shorthand packages to try first: `texlive-latex-extra`, `texlive-science`, `texlive-publishers`.
- **Missing Bibliography Style Fallback:** If `bibtex` fails with 'I couldn't open style file xxx.bst', first try `tlmgr install <bibtex-style-package>`. Only if the `.bst` file is a custom one bundled with the paper (not on CTAN) should you fallback to `\bibliographystyle{plainnat}` or `\bibliographystyle{unsrt}`.
- **Anti-Destruction Principle:** When fixing compilation errors or missing translations, NEVER extract files directly from the original tarball to overwrite existing `.tex` files, as this will destroy previously completed translations. Always inspect differences first.
- **Large File Handling Strategy:** For translating `.tex` files, favor replacing the entire file content using `write_file` over piece-meal updates with `replace` to prevent partial translations.
- **Integrity Verification:** Before declaring the task complete, explicitly check the translated document sections to ensure no section or subsection was accidentally reverted or skipped.

From dull-bird/DeepOrbit, MIT.

More from dull-bird/DeepOrbit

Signals

Stars
7
Forks
2
Open issues
0
Last commit (this folder)
Jul 24, 2026 (3 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from dull-bird

Cite this page

do.arxiv-translator skill. Agent Mart. https://agentmart.dev/skills/dull-bird-do-arxiv-translator (last updated 2026-10-24)