Description
pix2tex, also published as LaTeX-OCR, is a learning-based system that takes an image of a mathematical formula and returns the corresponding LaTeX code. It uses a vision transformer to read the formula. The package is installed from Python 3.7 or later, with PyTorch installed first if it is not already present, and the model checkpoints download automatically the first time you use it. There are three ways to get a prediction. You can use the command-line tool, which can read an existing image from disk or an image on the clipboard. The project's goal, stated in the README, is to create a learning-based system that converts images of maths into LaTeX, which is useful for turning a formula from a photograph, a scanned page or a screenshot into text that can be edited. Accuracy depends on the image quality and the formula's complexity, so a converted formula should be checked against the original before it is used in a document. The project is hosted on GitHub under lukas-blecher and is licensed as open source. It is a useful tool for students and researchers who have formulas in images and need editable LaTeX.…
Highlights
- Formula image to LaTeX
- Vision transformer model
- Command-line tool
- Reads images from disk or the clipboard
- Checkpoints download automatically
Ratings & Reviews
No ratings yet
Be the first to rate LaTeX-OCR.
People also visit
Pix2Text (P2T)
An Open-Source Python3 tool with SMALL models for recognizing layouts…
LaTeX-OCR FAQ
What does pix2tex do?
It converts an image of a mathematical formula into LaTeX code, using a vision transformer.
What do I need to install it?
Python 3.7 or later, and PyTorch if it is not already installed.
How do I use it?
Through its command-line tool, which can read an image from disk or from the clipboard, or through the other options in the README.
Are the model files downloaded?
Yes. The README says the model checkpoints download automatically.
Should I check the output?
Yes. Accuracy depends on the image, so the converted formula should be checked against the original.
What are the best LaTeX-OCR alternatives?
Popular alternatives to LaTeX-OCR include Pix2Text (P2T), RapidLaTeXOCR and Upmath.me. See all LaTeX-OCR alternatives


