A curated collection of mathematical formulas from English Wikipedia, providing LaTeX source code paired with high-quality rendered images for training OCR and formula recognition models.
This dataset represents a complete extraction of ~319k LaTeX mathematical formulas from English Wikipedia articles (October 2025 snapshot), filtered by visual complexity (score > 8) and renderability with standard LaTeX packages. Each formula is paired with its rendered PNG image at 200 DPI to support machine learning tasks in mathematical document understanding.
Key Features:
Each row contains:
formula (string): LaTeX source code (cleaned and normalized)image (Image): Rendered PNG image at 200 DPI
PIL.Image when accessedLoading the dataset:
from datasets import load_dataset
# Load from Hugging Face Hub
ds = load_dataset("piushorn/wikipedia-latex-formulas-319k")
# Access a sample
sample = ds['train'][0]
print(sample['formula'])
# Output: r(x):=b-Ax
sample['image'].show() # Displays rendered formula as PIL Image
The images were generated from the LaTeX source code using the following pipeline:
Pipeline: LaTeX source → pdflatex → PDF → ImageMagick → PNG image
LaTeX Template:
\documentclass[preview, border=5pt]{standalone}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage[version=4]{mhchem} % For chemical formulas
\usepackage{varwidth}
\begin{document}
\begin{varwidth}{25cm}
% Formula inserted here
\end{varwidth}
\end{document}
ImageMagick Conversion:
-density 200)-quality 100)Custom Resolution & Formats: Since the dataset includes raw LaTeX source, you can regenerate images at any DPI by adjusting ImageMagick's -density parameter, or convert to different formats (JPEG, SVG, etc.) and apply other customizations (background colors, padding, etc.). This is useful for training models at different resolutions or generating outputs tailored to specific requirements.
If you use this dataset in your research or project, please cite our paper:
@misc{horn2025benchmarking,
title = {Benchmarking Document Parsers on Mathematical Formula Extraction from PDFs},
author = {Horn, Pius and Keuper, Janis},
year = {2025},
eprint={2512.09874},
archivePrefix={arXiv},
primaryClass={cs.CV},
url = {https://arxiv.org/abs/2512.09874}
}
📄 Paper: arXiv:2512.09874
This work has been supported by the German Federal Ministry of Research, Technology and Space (BMFTR) in the program "Forschung an Fachhochschulen in Kooperation mit Unternehmen (FH-Kooperativ)" within the joint project LLMpraxis under grant 13FH622KX2.
Content License: CC BY-SA 4.0 (same as Wikipedia)
Dataset License: CC BY-SA 4.0
Wikipedia Snapshot: English Wikipedia, October 2025 Dataset Created: October 2025
A curated collection of mathematical formulas from English Wikipedia, providing LaTeX source code paired with high-quality rendered images for training OCR and formula recognition models.
This dataset represents a complete extraction of ~319k LaTeX mathematical formulas from English Wikipedia articles (October 2025 snapshot), filtered by visual complexity (score > 8) and renderability with standard LaTeX packages. Each formula is paired with its rendered PNG image at 200 DPI to support machine learning tasks in mathematical document understanding.
Key Features:
Each row contains:
formula (string): LaTeX source code (cleaned and normalized)image (Image): Rendered PNG image at 200 DPI
PIL.Image when accessedLoading the dataset:
from datasets import load_dataset
# Load from Hugging Face Hub
ds = load_dataset("piushorn/wikipedia-latex-formulas-319k")
# Access a sample
sample = ds['train'][0]
print(sample['formula'])
# Output: r(x):=b-Ax
sample['image'].show() # Displays rendered formula as PIL Image
The images were generated from the LaTeX source code using the following pipeline:
Pipeline: LaTeX source → pdflatex → PDF → ImageMagick → PNG image
LaTeX Template:
\documentclass[preview, border=5pt]{standalone}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage[version=4]{mhchem} % For chemical formulas
\usepackage{varwidth}
\begin{document}
\begin{varwidth}{25cm}
% Formula inserted here
\end{varwidth}
\end{document}
ImageMagick Conversion:
-density 200)-quality 100)Custom Resolution & Formats: Since the dataset includes raw LaTeX source, you can regenerate images at any DPI by adjusting ImageMagick's -density parameter, or convert to different formats (JPEG, SVG, etc.) and apply other customizations (background colors, padding, etc.). This is useful for training models at different resolutions or generating outputs tailored to specific requirements.
If you use this dataset in your research or project, please cite our paper:
@misc{horn2025benchmarking,
title = {Benchmarking Document Parsers on Mathematical Formula Extraction from PDFs},
author = {Horn, Pius and Keuper, Janis},
year = {2025},
eprint={2512.09874},
archivePrefix={arXiv},
primaryClass={cs.CV},
url = {https://arxiv.org/abs/2512.09874}
}
📄 Paper: arXiv:2512.09874
This work has been supported by the German Federal Ministry of Research, Technology and Space (BMFTR) in the program "Forschung an Fachhochschulen in Kooperation mit Unternehmen (FH-Kooperativ)" within the joint project LLMpraxis under grant 13FH622KX2.
Content License: CC BY-SA 4.0 (same as Wikipedia)
Dataset License: CC BY-SA 4.0
Wikipedia Snapshot: English Wikipedia, October 2025 Dataset Created: October 2025