Skip to content

A tool for translating the content of LaTeX documents into various other natural languages (e.g., translating an arXiv paper from English to Chinese).

License

Notifications You must be signed in to change notification settings

NiuTrans/LaTeXTrans

Repository files navigation

English | 中文

Turn arXiv Papers into Multilingual Masterpieces

• 📖 Introduction • 🛠️ Installation Guide • ⚙️ Configuration Guide • 📚 Usage • 🖼️ Translation Examples

End-to-end translation from arXiv paper ID to translated PDF. LaTeXTrans have the following Features :

  • 🌟 Preserve the integrity of formulas, layout, and cross-references
  • 🌟 Ensure consistency in terminology translation
  • 🌟 Support end-to-end conversion from original TeX source (automatically downloaded based on the arXiv paper id provided) to translated PDF

With LaTeXTrans, researchers and students can obtain higher-quality arXiv paper translations without worrying about formatting confusion or missing content, thus reading and understanding arXiv papers more efficiently.

📖 Introduction

LaTeXTrans is a structured LaTeX document translation system based on multi-agent collaboration. It directly translates LaTeX code and generates translated PDFs with high fidelity to the original layout. Unlike traditional document translation methods (e.g., PDF translation), which often break formulas and formatting, LaTeXTrans leverages LLM to translate preprocessed LaTeX sources and employs a workflow composed of six agents—Parser, Translator, Validator, Summarizer, Terminology Extractor, and Generator to achieve the features. The figure below illustrates the system architecture of LaTeXTrans.

🛠️ Installation Guide

1. Clone Repository

git clone https://github.com/PolarisZZM/LaTeXTrans.git
cd LaTeXTrans
pip install -r requirements.txt

2. Install MikTex(Recommended) or TeXLive

If you need to compile LaTeX files (e.g., generate PDF output), install MikTex or TeXLive !

Important

For MikTex, installation please be sure to select "install on the fly", in addition, you need to install additional Strawberry Perl support compilation.

⚙️ Configuration Guide

Local Configuration

Please edit the configuration file before use:

config/default.toml

Set the language model's API key and base URL in default.toml :

model = " " # model name (For example, deepseek-v3)
api_key = " " # your_api_key_here
base_url = " " # base url of the API

📚 Usage

Translation via ArXiv ID

Simply provide an arXiv paper ID to complete translation:

python main.py --arxiv ${xxxx}
# For example, 
# python main.py --arxiv 2508.18791

This command will:

  1. Download the LaTeX source code from arXiv and extract it
  2. Execute a workflow consisting of parsing, translation, refactoring and compilation
  3. Save the translated LaTeX project file of the paper and the PDF of the compiled translation in the outputs folder

Note

Although LaTeXTrans supports translation from any language to any language, the current version has only made relatively complete compilation adaptations for translation from English to Chinese. When translating to other languages, the final output pdf may contain errors. We welcome you to raise an issue to describe the problem you have encountered, and we will solve it case by case.

🖼️ Translation Examples

The following are three real translation examples generated by LaTeXTrans, with the original text on the left and translation results on the right.

📄 Case 1 ( en->ch ) :

Original Translation

📄 Case 2 ( en->ch ):

Original Translation

📄 Case 3 ( en->jp ):

Original Translation

📄 Case 4 ( en->jp ):

Original Translation

📂 See examples/ folder for more cases, including complete translation PDFs for each case.


Citation

@article{zhu2025latextrans,
  title={LaTeXTrans: Structured LaTeX Translation with Multi-Agent Coordination},
  author={Zhu, Ziming and Wang, Chenglong and Xing, Shunjie and Huo, Yifu and Tian, Fengning and Du, Quan and Yang, Di and Zhang, Chunliang and Xiao, Tong and Zhu, Jingbo},
  journal={arXiv preprint arXiv:2508.18791},
  year={2025}
}

About

A tool for translating the content of LaTeX documents into various other natural languages (e.g., translating an arXiv paper from English to Chinese).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •