Skip to main content

Translate math-heavy papers

Project description

MathTranslate

English | 简体中文

GUI download address

This is a project to provide translation of scientific papers with heavy math symbols from any language to any language while keeping the math symbols unchanged. In most translation softwares you wouldn't be able to keep equations and it would annoy you.

The main work of this project is to translate LaTeX files based on Google Translate in plain text, and finally realize the translation of pdf.

Here's an example of what you get finally.

Releases

Jun 24, 2023

We release the GUI for MathTranslate. You can open it directly without installing anything!

May 14, 2023

We add the ability to directly translate the whole arxiv project with just one click.

Mar 24, 2023

We add the ability to directly translate arxiv papers.

Mar 21, 2023

We add tencent translation option for users with IP in China mainland.

Mar 16, 2023

We are now supporting all operating systems! Now you can install simply by pip install --upgrade mathtranslate.

这里是中文介绍地址

Backend engine

The default engine is google translate, which can not be accessed with IP in mainland China. For users with IP in mainland China we provide the tencent engine, although its accuracy is not as good as the google engine. To use the tencent engine, you need to register the Tencent Translation API account. After registration, you can get the secret ID (not the APP ID!) and secret Key in Tencent Console. Tencent Translate is the translation API with the highest free quota to our knowledge besides Google Translate, with a free quota of 5 million characters per month, and no fee will be deducted if there is no manual recharge (that is, there is no need to worry about misuse).

GUI Installation (not stable now)

Simply download the corresponding executable file and you are done!

GUI usage (not stable now)

You can set the translation engine and language in the Preference page. If you plan to use the tencent engine, you need to set the secret ID and secret Key.

  1. If you want to translate a paper on arxiv, you can use the Arxiv Translate function. You just need to enter the arxiv number of the paper you want to translate (for example 2205.15510). After the translation you will get a .zip file, which contains the latex source code of the arxiv project.
  2. If you want to translate a paper only with pdf version, you can first convert the pdf to latex by mathpix and then use the File Translate function. Unfortunately, mathpix requires a fee after exceeding a certain amount of usage. Here is the price list. After the translation you will get a .tex file which contains the corresponding latex file.

After the translation is done you can upload either the .zip (New Project - Upload Project) or .tex (New Project - Blank Project and copy-paste) file to overleaf for online compilation. Note: you have to set the compiler to XeLatex in Menu - Compiler.

Command line installation

  1. Install python3 and pip.
  2. pip install --upgrade mathtranslate

Command line usage

For Windows user you may need to run cmd or powershell as administrator.

  1. Prepare or generate a tex file or project. You can obtain a tex file or project in the following ways:
    • For most arxiv papers, the latex source code is public, and we provide a simple API to translate the entire project with just one click using an arxiv number.
    • Use mathpix to convert the pdf you want to translate into latex code. Mathpix can directly convert pdf or screenshot to latex code. Unfortunately, mathpix requires a fee after exceeding a certain amount of usage. Here is the price list.
  2. (For Tencent Translation API users) Run translate_tex --setkey to store the API secretID and secretKey.
  3. Translate the tex file or project in command line.
    • To translate a single file: translate_tex input.tex -o output.tex will generate a translated tex file output.tex.
    • To translate an arxiv project: translate_arxiv 2205.15510 will generate a translated tex project 2205.15510.zip.
  4. Compile your tex file. For a single file, you can use the command xelatex output.tex from texlive. Chinese translation requires the xeCJK package. For arxiv projects, we recommend uploading the obtained .zip file to overleaf for online compilation (New Project - Upload Project). Note that you need to set the compiler to XeLatex in Menu - Compiler.
  5. You can change the default settings of translation language and engine through command line arguments -engine, -from, -to. For example, translate_tex -engine tencent input.tex -o output.tex. You can also permanently change the settings through translate_tex --setdefault. You can view more details through translate_tex --help. translate_arxiv also provides exactly the same command line arguments, which have the same effect.

If you have any questions or have interests in making contributions, please contact me by susyustc@gmail.com or joining QQ group 288646946.

Donation

If you think this project is helping you a lot, you can support us by the Wechat QR code below

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mathtranslate-3.0.2.tar.gz (46.4 kB view details)

Uploaded Source

Built Distribution

mathtranslate-3.0.2-py3-none-any.whl (56.8 kB view details)

Uploaded Python 3

File details

Details for the file mathtranslate-3.0.2.tar.gz.

File metadata

  • Download URL: mathtranslate-3.0.2.tar.gz
  • Upload date:
  • Size: 46.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for mathtranslate-3.0.2.tar.gz
Algorithm Hash digest
SHA256 79438dfe581611ea46e895bacf6d930e548d0408f2c55ed6b7dc27f22c6895cc
MD5 60dd63bae36b73cbb85885c36ce5d35e
BLAKE2b-256 b79519d18623171eecbc0be1fc860dd3ba0cf42b685ed1487304d6da9f102adf

See more details on using hashes here.

File details

Details for the file mathtranslate-3.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mathtranslate-3.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 670a8a3d869307c7cca21516ee43586c945fa5fd6ef5062a7ab374d25307e609
MD5 a34fada94478a4e8065727c163aac4b5
BLAKE2b-256 d2493c1a67047586c39b501e9d4761d37d89ab557fb99fcf14edfef38aa47585

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page