/TransLaTeX

TransLaTeX is a simple tool for translating LaTeX projects using Large Language Models. It can automatically translate LaTeX sources from any language to any other language with precision and customization.

Primary LanguagePythonMIT LicenseMIT

TransLaTeX

TransLaTeX is a simple tool for translating LaTeX projects using Large Language Models. It can automatically translate LaTeX sources from any language to any other language with precision and customization.

▶️ 为什么有这个项目?

▶️ 用户指南

可能有较多 bug,欢迎 报告问题 | 中文 UI 有待填坑,目前进度 0%

Screenshots

Paper that is automatically translated by TransLaTeX:

Intuitive text-based user interface:

Quick Start

Install TransLaTeX with pipx:

pipx install git+https://github.com/habaneraa/TransLaTeX.git

And launch the app in CLI directly!

trans-latex

If you do not use pipx, you can install TransLaTeX in your Python virtual environment.

Create a Python 3.12 virtual environment and run:

pip install git+https://github.com/habaneraa/TransLaTeX.git

Or clone the source code:

git clone https://github.com/habaneraa/TransLaTeX.git
cd TransLaTeX
pip install -e .

Then launch the application by:

python -m trans_latex

FAQ

Q: How to copy/paste texts in the terminal UI?

A: Try Ctrl+Shift+C/V. This works on Windows Terminal.

How does it work?

  1. Download the LaTeX sources from arXiv.
  2. Find and parse the main document source file and recursively find all referenced ".tex" source files.
  3. LLMs could have limited context length. A single paper may have more than 20k tokens. It will divide the LaTeX texts into smaller pieces with a proper size (smaller than the specified chunk size).
  4. Use LLM API service (e.g. ChatGPT from OpenAI) to translate all of the LaTeX text chunks.
  5. Create a new project with the translated files, keeping the project structure unchanged.
  6. Compile the source and obtain the translated paper! (by yourself)