CoolFace
Datasetpublic

OleehyO/latex-formulas

๐‘ฉ๐‘ฐ๐‘ฎ ๐‘ต๐‘ฌ๐‘พ๐‘บโ€ผ๏ธ ๐Ÿ“ฎ [2025-08] We have updated to a larger dataset, which contains nearly 80 million samples, with significant improvements in both data quality and diversity. [link] ๐Ÿ“ฎ [2024-02] We trained a formula recognition model, ๐“๐ž๐ฑ๐“๐ž๐ฅ๐ฅ๐ž๐ซ, using the latex-formulas dataset. It can convert LaTeX formulas into images and boasts high accuracy and strong generalization capabilities, covering most formula recognition scenarios. For more details, please refer to theโ€ฆ See the full description on the dataset page: https://huggingface.co/datasets/OleehyO/latex-formulas.

sourceHugging Faceopenrailupdated 1y agoView on Hugging Face
103likes402downloads
Dataset Card

๐‘ฉ๐‘ฐ๐‘ฎ ๐‘ต๐‘ฌ๐‘พ๐‘บโ€ผ๏ธ

๐Ÿ“ฎ [2025-08] We have updated to a larger dataset, which contains nearly 80 million samples, with significant improvements in both data quality and diversity. [[link](https://huggingface.co/datasets/OleehyO/latex-formulas-80M)]

๐Ÿ“ฎ [2024-02] We trained a formula recognition model, ๐“๐ž๐ฑ๐“๐ž๐ฅ๐ฅ๐ž๐ซ, using the latex-formulas dataset. It can convert LaTeX formulas into images and boasts high accuracy and strong generalization capabilities, covering most formula recognition scenarios.

For more details, please refer to the ๐“๐ž๐ฑ๐“๐ž๐ฅ๐ฅ๐ž๐ซ GitHub repository.

Dataset Description

ไธญๆ–‡็‰ˆๆœฌ

There are two datasets: raw_formulas and cleaned_formulas(This dataset has 550K formula-image pairs).

We scraped approximately 1 million LaTeX formula image-text pairs from arxiv that were uncleaned and without text segmentation to create the raw_formulas dataset. After cleaning the raw_formulas dataset and integrating it with the im2latex-100K dataset, we obtained the cleaned_formulas dataset, which has 550K formula-image pairs.

To render the images corresponding to the formulas, the following external packages are needed:

  • โ€”amsmath
  • โ€”amsfonts
  • โ€”amssymb
  • โ€”mathtools

Usage

for raw_formulas dataset:

python
from datasets import load_dataset
data = load_dataset("OleehyO/latex-formulas", "raw_formulas") 

for cleaned_formulas dataset:

python
from datasets import load_dataset
data = load_dataset("OleehyO/latex-formulas", "cleaned_formulas") 

Details About the raw_formulas Dataset

We scraped LaTeX formulas containing the following environments:

  • โ€”equation
  • โ€”align
  • โ€”align*
  • โ€”gather
  • โ€”gather*

The formulas do not include the following content:

  • โ€”\label
  • โ€”%
  • โ€”\quad
  • โ€”\qquad
  • โ€”\vspace
  • โ€”\hspace
  • โ€”\resizebox
  • โ€”\scalebox
  • โ€”\rotatebox
  • โ€”\parbox
  • โ€”\fbox
  • โ€”\makebox
  • โ€”\raisebox
  • โ€”\addvspace
  • โ€”\hfill
  • โ€”\vfill
  • โ€”\textwidth
  • โ€”\textheight
  • โ€”\rule

Preprocessing Details of the cleaned_formulas Dataset

Cleaning

  • โ€”We removed some useless junk data from both raw_formulas and im2latex-100K.
  • โ€”We deleted overly complex formulas from both raw_formulas and im2latex-100K:
  • โ€”Formulas were deleted if the aspect ratio of the corresponding rendered image was greater than 0.8.
  • โ€”Formulas with a character length greater than 200 were deleted.
  • โ€”In the formulas from both raw_formulas and im2latex-100K, the following content was removed:
  • โ€”\tag
  • โ€”\text
  • โ€”\begin{split}
  • โ€”\end{split}
  • โ€”\nonumber
  • โ€”\notag
  • โ€”The equation, equation*, align, \[...\] environments in raw_formulas were all replaced with the align* environment.
  • โ€”We deleted formulas from raw_formulas that contained custom macros.