AI Personal Learning
and practical guidance

MathTranslate: LaTeX Translation Tool for Scientific Papers

General Introduction

MathTranslate is an online tool for translating LaTeX documents, especially for scientific papers. The tool is able to keep LaTeX expressions (e.g. mathematical expressions) unchanged and ultimately compile LaTeX documents into PDF files.MathTranslate provides an interface for translating by entering the arXiv paper number directly, as well as for translating via the Mathpix Generate LaTeX code from PDF and then translate it.

MathTranslate: LaTeX translation tool for scientific papers-1

Source : http://mathtranslate.xyz/


 

Function List

  • Translate LaTeX documents online
  • Multi-language translation support
  • Keeping the math expression the same
  • Compiling LaTeX documents into PDF files
  • Support for direct translation of arXiv papers
  • Provides command line usage
  • Support Donation Function

 

Using Help

Installation and use

MathTranslate offers two main ways to use it: web server and command line use.

Web servers (recommended for beginners)

  1. Visit MathTranslate's online translation site.
  2. Enter the number of the arXiv paper to be translated, or upload a file containing the LaTeX code.
  3. Click the Translate button and wait for the translation result to be generated.
  4. Download the generated PDF file.

Command line use (for advanced users)

  1. Install Python3 and pip:
    sudo apt-get install python3 python3-pip
    
  2. Install MathTranslate:
    pip install --upgrade mathtranslate
    
  3. For Windows users, you may need to run cmd or powershell as an administrator.

Prepare or generate a tex file or project

  1. For most arXiv papers, the LaTeX source code is publicly available. MathTranslate provides a simple API to translate an entire project from an arXiv number in one click.
  2. Use Mathpix to convert the PDFs you want to translate into LaTeX code.Mathpix can convert PDFs or screenshots directly into LaTeX code, but there is a fee after a certain number of uses.

Using Tencent Translation API

  1. Register for a Tencent Translator API account and get the secret ID and secret Key in the Tencent console.
  2. Run the following command to store the API secretID and secretKey:
    translate_tex --setkey
    

Translating tex files or projects using the command line

  1. Translate individual documents:
    translate_tex input.tex -o output.tex
    

    This generates the translated tex file output.tex.

  2. Translation of the arXiv project:
    translate_arxiv 2205.15510
    

    This will generate the translated tex project 2205.15510.zip.

Compile your tex file

  1. For single files, the command xelatex output.tex from texlive can be used to compile them. The Chinese translation requires the xeCJK package.
  2. For arXiv projects, it is recommended to upload the resulting .zip file to the Overleaf online compiler (New Project - Upload Project). Note that the XeLatex compiler needs to be set in Menu - Compiler.

Change default settings for translation languages and engines

  1. The default settings for translation language and engine can be changed with the command line arguments -engine, -from, -to. Example:
    translate_tex -engine tencent input.tex -o output.tex
    
  2. The settings can be permanently changed with the following command:
    translate_tex ---setdefault
    
  3. More details can be viewed with the following command:
    translate_tex --help
    

    translate_arxiv also provides exactly the same command line arguments, and they have the same effect.

Customized commands

During the translation process, you may encounter some content not being translated, which is usually caused by some custom commands not being recognized. In the command line mode, the function of custom commands is provided, you just need to create a file (e.g. MT_additional_commands.txt), in which you define the commands that need to be translated, for example:

# if you need more, just add lines with the same format (don't miss the ","!)
# each line is in the format of (command_name, N, (n1, n2, ...)) , 
# N is the total number of arguments, and the total number of arguments that have been made in the past three years is #. 
# n1, n2, ... are the index of arguments requiring translation (counting from 0). are the index of arguments requiring translation (counting from 0)
additional_commands = [
  # latex: \mycommand1{translation needed}
  ('mycommand1', 1, (0, )),
  # latex: \mycommand2{translation not needed}{translation needed}
  ('mycommand2', 2, (1, )),
  # latex: \mycommand3{translation needed}{translation not needed}
  ('mycommand3', 2, (0, )),
  # latex: \mycommand4{translation needed}{translation not needed}{translation needed}{translation not needed}
  ('mycommand4', 4, (0, 2)),
  # practical example: \textcolor{red}{Need translation here}
  ('textcolor', 2, (1, )),
]

Then add the command line argument -commands MT_additional_commands.txt to translate the customized commands.

AI Easy Learning

The layman's guide to getting started with AI

Help you learn how to utilize AI tools at a low cost and from a zero base.AI, like office software, is an essential skill for everyone. Mastering AI will give you an edge in your job search and half the effort in your future work and studies.

View Details>
May not be reproduced without permission:Chief AI Sharing Circle " MathTranslate: LaTeX Translation Tool for Scientific Papers

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish