GithubHelp home page GithubHelp logo

habaneraa / translatex Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 1.0 773 KB

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.

License: MIT License

Python 100.00%
cli-tool latex llm python terminal-app translation tui

translatex's Introduction

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)

translatex's People

Contributors

habaneraa avatar spaceskynet avatar sweep-ai[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

spaceskynet

translatex's Issues

自选api按钮失效

配置第二步的时候,API输入框状态发生变化会导致下面的验证按钮失效,无法继续配置下去,理论上应该刷新为有效状态

image

How to use chatgpt 4?

Details

If I want to use chatgpt4 model to translate latex, what should I do?

Checklist
  • Modify latextranslator/chat.py6f0c5e5 Edit
  • Running GitHub Actions for latextranslator/chat.pyEdit
  • Modify latextranslator/translator.py ! No changes made Edit
  • Running GitHub Actions for latextranslator/translator.pyEdit

README中存在错误

Quick Start

Or clone the source code:

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

pip install . -e
应该是pip install -e .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.