Paper Translation
Overview
Translate an English paper or report PDF into a polished Chinese-first HTML reader. Invoke $pdf first for layout-aware inspection, then translate in sentence-aligned bilingual units, build the final page from assets/reader-template.html, and remove only run-specific temporary files after requesting cleanup permission.
Workflow
- Confirm scope.
- Use this workflow only when the user explicitly asks for a Chinese version or full translation of an English PDF.
- Skip this skill for summaries, abstract-only translation, citation extraction, or ad hoc questions about the paper.
- Parse the PDF with
$pdf.
- Inspect metadata, page count, reading order, column structure, headings, figures, tables, captions, footnotes, references, and equation placement.
- Prefer rendered-page inspection over raw text order whenever extraction looks ambiguous.
- Preserve page and block provenance so translated content can keep figure, table, and caption context.
- Build sentence-aligned bilingual units.
- Segment the English source at sentence level.
- Translate into Chinese at sentence level and keep a one-to-one mapping between English and Chinese sentences.
- Assign a stable id such as
s0001to every aligned pair. - Re-segment or rewrite when a first pass would create one-to-many or many-to-one alignment.
- Track block type for each pair: paragraph, heading, caption, table cell, footnote, reference entry, or list item.
- Maintain a working glossary and reuse the same Chinese term for the same English technical term unless the user requests a different convention.
- Read
references/workflow.mdwhen alignment, glossary, table handling, or tooltip markup becomes non-trivial.
- Translate in academic style.
- Preserve meaning, qualifiers, modality, citation markers, symbols, units, and equation numbering.
- Prefer precise, formal Chinese over colloquial paraphrase.
- Translate figure and table titles, notes, and cell text while keeping numbers, units, and labels stable.
- Do not silently drop uncertainty, negation, limitations, or methodological caveats from the source.
- Compose the Chinese HTML reader.
- Use
assets/reader-template.htmlas the starting template. - Make Chinese the default reading layer; do not expose English continuously if it hurts readability.
- Wrap each translated sentence in an element that carries the aligned English sentence in a data attribute or nearby node.
- Reveal the English sentence only on hover or focus, preferably as a tooltip or anchored popover that does not shift document flow.
- Keep figures, tables, captions, and section hierarchy visually clear on both desktop and mobile.
- Preserve alignment ids in the DOM so later revisions can target exact sentence pairs.
- Keep the final HTML self-contained unless the user explicitly asks for split assets.
- Deliver final outputs.
- Prefer a final artifact such as
dist/{pdf-stem}-zh.html. - Keep the original PDF untouched.
- Keep a glossary or alignment manifest only when it materially helps review or revision.
- Clean up temporary files.
- Delete only intermediate files created for the current run, such as rendered page images, OCR caches, raw extraction dumps, temporary sentence manifests, and scratch HTML fragments.
- Never delete the source PDF, the final HTML, or user-authored notes.
- Read
references/cleanup.mdbefore deletion. - Request permission before cleanup with a justification that names the exact temporary paths and explains the effect, for example: delete rendered pages and extraction caches created for this translation while preserving the source PDF and final HTML.
- If permission is denied, keep the temporary files and tell the user exactly what remains.
Output standard
- Produce polished Chinese typography, spacing, and hierarchy.
- Ensure every visible Chinese sentence can reveal the exact aligned English sentence on hover or focus.
- Keep tooltip behavior subtle: hidden at rest, easy to dismiss, and non-blocking for continuous reading.
- Recheck figure and table placement after translation so dense pages remain readable.
- Prefer deterministic filenames and stable ids across revisions.
References
- Read
references/workflow.mdfor the detailed alignment model, glossary rules, and HTML structure. - Read
references/cleanup.mdbefore removing any generated files.


