Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | 中文

Turn arXiv Papers into Multilingual Masterpieces

• 📖 Introduction • 🛠️ Installation Guide • ⚙️ Configuration • 🐳 Docker • 📚 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

This project no longer uses config/default.toml. All configuration is provided via environment variables.

Required (LLM):

  • LTX_BASE_URL or BASE_URL: LLM API base URL (e.g. https://api.deepseek.com/v1/chat/completions)
  • LTX_API_KEY or API_KEY: LLM API key
  • LTX_MODEL or MODEL: model name (e.g. deepseek-chat)

Optional:

  • LTX_CONCURRENCY or CONCURRENCY: concurrent translation requests (default 10)
  • ARXIV_BASE_URL: base domain for arXiv (default https://arxiv.org), set this if you use a mirror
  • LTX_TARGET_LANGUAGE (default ch), LTX_SOURCE_LANGUAGE (default en)
  • LTX_MODE (default 0), LTX_USER_TERM (path or empty)
  • APP_PASSWORD: password for logging into the web UI (required when using the Docker service UI)
  • JWT_SECRET (default dev-secret), TOKEN_TTL_SECONDS (default 604800)

Recommended base_url samples:

Model base_url
deepseek-chat https://api.deepseek.com/v1/chat/completions
gpt-4o https://api.openai.com/v1/chat/completions
gemini-2.5-pro https://generativelanguage.googleapis.com/v1beta/openai/chat/completions

🐳 Docker

Build the frontend+backend image:

docker build -t latextrans .

Run with environment variables:

docker run -p 8000:8000 \
  -e APP_PASSWORD=your_password \
  -e LTX_BASE_URL=https://api.deepseek.com/v1/chat/completions \
  -e LTX_API_KEY=sk-xxx \
  -e LTX_MODEL=deepseek-chat \
  -e LTX_CONCURRENCY=16 \
  -e ARXIV_BASE_URL=https://arxiv.org \
  latextrans

Then open http://localhost:8000, login with APP_PASSWORD, and submit arXiv IDs.

📚 Usage

Translation via ArXiv ID

Simply provide an arXiv paper ID to complete translation:

# set envs for local CLI usage
export LTX_BASE_URL=...
export LTX_API_KEY=...
export LTX_MODEL=...
export LTX_CONCURRENCY=10

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 and the compiled translation PDF 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

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages