Logo de Pdf Translate

Pdf Translate

Comunidade
L27z18328742
pdf-translate

Translate English PDF documents (especially academic papers) into Chinese using PDFMathTranslate-next (pdf2zh), producing a monolingual Chinese PDF and a bilingual side-by-side PDF with formulas, figures, and layout preserved. Automatically installs the pdf2zh_next environment via uv and reuses the model/API the user already configured in Codex or Claude Code (any OpenAI-compatible gateway), falling back to the free SiliconFlow service when no key is present. Use this skill whenever the user wants to translate a PDF to Chinese (or another language), translate a paper/论文, produce a bilingual PDF, or mentions pdf2zh / PDFMathTranslate — even if they don't name the tool explicitly. Proactively invoke this skill (do not translate manually) whenever a PDF translation task appears.

Visão geral

Publicado porL27z18328742
Repositóriopdf-translate
Nome da habilidadepdf-translate
Estrelas
73
Forks
6
Arquivos incluídos
4
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Arquivos incluídos: 4

    Scripts, templates e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente para leitura e nunca são executados.

  • Código aberto

    Publicada por L27z18328742 no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Pdf Translate no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/L27z18328742/pdf-translate/tree/main
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/L27z18328742/pdf-translate.git \
  .claude/skills/pdf-translate
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Pdf Translate em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Pdf Translate automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Pdf Translate não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

PDF Translate (English → Chinese)

This skill translates PDF documents using PDFMathTranslate-next (pdf2zh_next), the BabelDOC-based translator that preserves formulas, charts, table of contents, and page layout. It produces two files per input:

  • *-mono.pdf — monolingual translated PDF (Chinese only)
  • *-dual.pdf — bilingual PDF (original + translation, side by side or alternating)

Why this skill exists

Translating an academic PDF well requires preserving math, figures, and layout — something plain LLM translation can't do. pdf2zh_next handles that, but it has a non-trivial install (Python 3.12, model assets) and many engine options. This skill automates the environment setup and picks a translation engine that reuses credentials the user already has, so translation "just works" without manual configuration.

Workflow

Run the setup script first (installs pdf2zh_next if missing, verifies it), then the translate script (detects the best engine and runs the translation). Both scripts are idempotent.

Subsequent runs are fast. Once pdf2zh_next is installed and the model assets are downloaded (after the first successful translation), setup.sh becomes a silent sub-second no-op — it detects the install and the ~/.cache/babeldoc/models cache and returns immediately without spawning a Python import or re-downloading anything. Re-running it on every invocation is cheap and safe; you do not need to track whether setup has happened before.

Step 1 — Ensure the environment is ready

bash
bash ~/.claude/skills/pdf-translate/scripts/setup.sh

This installs pdf2zh_next via uv tool install --python 3.12 pdf2zh-next (the project requires Python ≥3.10,<3.14; 3.12 is the documented recommendation) and confirms it is on PATH. It is fast and safe to re-run. The first real translation downloads layout/translation model assets (DocLayout-YOLO + fonts, ~hundreds of MB) into ~/.cache/babeldoc/ — tell the user the first run is slow because of this one-time download. The setup and translate scripts detect this cache and skip the "slow first run" messaging once the models are present.

Step 2 — Translate

bash
bash ~/.claude/skills/pdf-translate/scripts/translate.sh "<input.pdf>" [options]

The script auto-detects a translation engine:

  1. ClaudeCode (default when claude CLI is available) — detects if the user is running from Claude Code by checking for the claude CLI on PATH. Uses the exact model Claude Code is configured to use (resolved via ANTHROPIC_DEFAULT_SONNET_MODEL, etc.). This is the default when working in Claude Code, so the translation uses the same model ecosystem the user is already in. Note: it spawns one claude -p subprocess per text segment, so it is slower than the OpenAI engine.
  2. OpenAI-compatible (fallback when API key exists) — used when claude CLI is not found but OPENAI_API_KEY is set. Reuses the model configured for Codex: reads base_url + model from ~/.codex/config.toml and the API key from OPENAI_API_KEY. Fast (HTTP, high concurrency), ideal for full papers.
  3. SiliconFlowFree (zero-config fallback) — used when neither claude CLI nor API key is detectable. The project's free GLM-4-9B service; needs no key. Note: file content is forwarded through the project maintainer's server.

Override detection with flags: --engine openai|siliconflowfree|claudecode, --model <name>, --base-url <url>, --api-key <key>.

Common options:

  • --output <dir> — output directory (default: an output/ folder next to the input PDF)
  • --pages "1-5,8" — translate only some pages
  • --lang-in en --lang-out zh-CN — language codes (defaults: en → zh-CN)
  • --qps N --pool-max-workers N — concurrency tuning (see references/advanced.md)
  • --no-dual / --no-mono — suppress one of the two outputs
  • Pass any other pdf2zh_next flag through with -- <flag> <value>

Step 3 — Report results

After the script finishes, it prints the paths of the generated *-mono.pdf and *-dual.pdf. Tell the user where these files are (relative to the input), open/preview them if asked, and note the engine + model that was used. If the user wants different quality or speed, suggest overrides (see references/advanced.md).

Default behavior choices (and how to change them)

  • Source/target language: English → Simplified Chinese (en → zh-CN). Override with --lang-in / --lang-out. Full language code list is in references/advanced.md.
  • Engine: ClaudeCode when claude CLI is on PATH (default in Claude Code), else OpenAI-compatible when a key is found, else SiliconFlowFree. Use --engine openai to force the OpenAI engine even from Claude Code. The claudecode engine reuses Claude Code's configured model; the OpenAI engine reuses the model named in ~/.codex/config.toml.
  • Model: for the openai engine, the model from ~/.codex/config.toml; for claudecode, sonnet (resolved by Claude Code to the user's configured model). Reasoning models (e.g. gpt-5.5, glm-5.2) work but are slower and use more tokens; for large papers consider a lighter chat model via --model.
  • Concurrency: modest defaults (--qps 10 --pool-max-workers 30 for the OpenAI engine; --qps 4 --pool-max-workers 8 for claudecode since each segment is a subprocess). Increase for faster translation if the gateway allows it.

When something goes wrong

  • command not found: pdf2zh_next after install — the uv tool bin dir isn't on PATH. The scripts add ~/.local/bin to PATH themselves, but if the user runs pdf2zh_next directly in their own shell, they need export PATH="$HOME/.local/bin:$PATH" (Linux/macOS).
  • First translation hangs on "loading assets" / downloading — normal one-time model download. Wait it out.
  • 429 / rate-limit errors — lower --qps and --pool-max-workers.
  • Gateway returns errors for the OpenAI engine — the detected base_url may only expose the responses API, not chat-completions. Run with --engine siliconflowfree to bypass, or point --base-url at a chat-completions endpoint.
  • Out-of-memory / very large PDFs — use --pages to translate in chunks, or --max-pages-per-part 50.

For the full option reference, engine configuration details, translating to other languages, glossaries, and offline/air-gapped usage, read references/advanced.md.

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Pdf Translate faz?

Translate English PDF documents (especially academic papers) into Chinese using PDFMathTranslate-next (pdf2zh), producing a monolingual Chinese PDF and a bilingual side-by-side PDF with formulas, figures, and layout preserved. Automatically installs the pdf2zh_next environment via uv and reuses the model/API the user already configured in Codex or Claude Code (any OpenAI-compatible gateway), falling back to the free SiliconFlow service when no key is present. Use this skill whenever the user wants to translate a PDF to Chinese (or another language), translate a paper/论文, produce a bilingual...

Por que usar Pdf Translate no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Pdf Translate é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Pdf Translate no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/L27z18328742/pdf-translate/tree/main. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Pdf Translate?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Pdf Translate?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Pdf Translate com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Pdf Translate é gratuita?

A habilidade é publicada no GitHub por L27z18328742. Consulte os termos de licenciamento no repositório. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇