skills/43-wentorai-research-plugins/skills/tools/ocr-translate/pdf-math-translate-guide/SKILL.md
Translate scientific PDFs with preserved math formatting via PDFMathTranslate
npx skillsauth add brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research pdf-math-translate-guideInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
PDFMathTranslate is an open-source tool designed specifically for translating scientific and technical PDF documents while preserving mathematical formulas, tables, figures, and the overall layout structure. Traditional PDF translators often mangle equations and destroy formatting, making translated papers difficult to read. PDFMathTranslate solves this problem by intelligently detecting and preserving mathematical content during the translation process.
The tool leverages large language models for high-quality translation while maintaining the integrity of LaTeX-rendered equations, chemical formulas, and complex table structures commonly found in academic publications. It supports translation between dozens of language pairs, making it invaluable for researchers who need to read papers published in languages outside their expertise.
PDFMathTranslate has gained significant traction in the academic community with over 32,000 GitHub stars, reflecting the widespread need for reliable scientific document translation that respects the specialized formatting requirements of research papers.
Install PDFMathTranslate using pip in a Python environment (Python 3.8 or higher required):
pip install pdf2zh
For GPU-accelerated processing, install with CUDA support:
pip install pdf2zh[cuda]
Configure your translation backend by setting the appropriate environment variable. The tool supports multiple LLM providers:
# Using OpenAI-compatible APIs
export OPENAI_API_KEY=$OPENAI_API_KEY
export OPENAI_BASE_URL=$OPENAI_BASE_URL
# Using Google Translate (free, no key required)
pdf2zh input.pdf -s google
# Using DeepL
export DEEPL_AUTH_KEY=$DEEPL_AUTH_KEY
pdf2zh input.pdf -s deepl
You can also launch the web-based GUI for interactive use:
pdf2zh -g
This starts a Gradio interface where you can upload PDFs and configure translation settings through a browser.
PDFMathTranslate provides several capabilities critical for academic workflows:
Formula Preservation: The tool detects and preserves inline and display math environments. Equations rendered in LaTeX, MathML, or image-based formats are identified and left untouched during translation, ensuring mathematical accuracy is maintained.
Layout Retention: The translated output maintains the original page layout including headers, footers, figure positions, table structures, and column formatting. This produces a readable document that mirrors the source paper structure.
Batch Processing: Translate multiple papers at once using wildcard patterns or directory inputs:
# Translate all PDFs in a directory
pdf2zh ./papers/*.pdf -lo zh -li en
# Specify output directory
pdf2zh input.pdf -o ./translated/
Dual-Document Output: Each translation generates two files: a fully translated version and a side-by-side bilingual version where original and translated text appear together, useful for verifying translation quality.
Selective Translation: Target specific page ranges to avoid translating references, appendices, or supplementary material:
# Translate only pages 1 through 15
pdf2zh input.pdf -p 1-15
PDFMathTranslate fits naturally into several academic research scenarios:
Literature Review Acceleration: When conducting systematic reviews across multilingual sources, batch-translate candidate papers to quickly assess relevance before investing time in detailed reading. The preserved formatting means figures and data tables remain interpretable.
Collaboration Across Languages: Research teams spanning multiple countries can share translated versions of key papers while maintaining the mathematical rigor of the original. The bilingual output mode is particularly useful for group discussions where team members have different language proficiencies.
Conference Preparation: When presenting at international conferences, translate your own papers or related works to prepare for questions and discussions in the host language.
Integration with Reference Managers: Combine with Zotero or Mendeley workflows by translating downloaded papers and storing both versions in your reference library:
# Example workflow with a Zotero storage directory
for pdf in ~/Zotero/storage/*/*.pdf; do
pdf2zh "$pdf" -lo zh -li en -o ~/translated_papers/
done
Quality Verification: Always use the bilingual output mode when translation accuracy is critical. Cross-reference translated equations with the original to catch any edge cases where formula detection may have been imprecise.
Fine-tune translation behavior through configuration options:
# Use a specific model for translation
pdf2zh input.pdf -s openai -m gpt-4o
# Set custom font for translated text
pdf2zh input.pdf --font "Noto Sans CJK SC"
# Adjust thread count for parallel processing
pdf2zh input.pdf -t 4
For programmatic use, PDFMathTranslate can be integrated into Python scripts:
from pdf2zh import translate
# Basic translation
translate.translate(
files=["paper.pdf"],
lang_out="zh",
lang_in="en",
service="google"
)
development
Conduct rigorous thematic analysis (TA) of qualitative data following Braun and Clarke's (2006) six-phase framework. Use whenever the user mentions 'thematic analysis', 'TA', 'Braun and Clarke', 'qualitative coding', 'identifying themes', or asks for help analysing interviews, focus groups, open-ended survey responses, or transcripts to identify patterns. Also trigger for questions about inductive vs theoretical coding, semantic vs latent themes, essentialist vs constructionist epistemology, building a thematic map, or writing up a qualitative findings section. Covers all six phases, the four upfront analytic decisions, the 15-point quality checklist, and the five common pitfalls. Produces a Word document write-up and an annotated thematic map. Does NOT cover IPA, grounded theory, discourse analysis, conversation analysis, or narrative analysis — use a different method for those.
development
Guide users through writing a systematic literature review (SLR) following the PRISMA 2020 framework. Use this skill whenever the user mentions 'systematic review', 'systematic literature review', 'SLR', 'PRISMA', 'PRISMA 2020', 'PRISMA flow diagram', 'PRISMA checklist', or asks for help writing, structuring, or auditing a literature review that follows reporting guidelines. Also trigger when the user asks about inclusion/exclusion criteria for a review, search strategies for databases like Scopus/WoS/PubMed, study selection processes, risk of bias assessment, or narrative synthesis for a review paper. This skill covers the full PRISMA 2020 checklist (27 items), produces a Word document manuscript in strict journal article format, generates an annotated PRISMA flow diagram, and enforces APA 7th Edition referencing throughout. It does NOT cover meta-analysis or statistical pooling. By Chuah Kee Man.
testing
Performs placebo-in-time sensitivity analysis with hierarchical null model and optional Bayesian assurance. Use when checking model robustness, verifying lack of pre-intervention effects, or estimating study power.
data-ai
Fit, summarize, plot, and interpret a chosen CausalPy experiment. Use after the causal method has been selected, including when configuring PyMC/sklearn models and scale-aware custom priors.