Dataset Viewer
Auto-converted to Parquet Duplicate
image
imagewidth (px)
1
20.5k
text
stringlengths
1
7.06k
n\to\infty
_{DD}
\begin{array}{rl}{\langle u|u|^{2},b_{j,1}\rangle}&{=\sum_{k,l,m}\frac{A_{k}A_{l}A_{m}}{L_{k}L_{l}L_{m}}\left\langle e^{i\Gamma_{k}+i\Gamma_{l}-i\Gamma_{m}}e^{-\frac{|y_{k}|^{2}+|y_{l}|^{2}+|y_{m}|^{2}}{2}},e^{i\Gamma_{j}}e^{-\frac{1}{2}|y_{j}|^{2}}\right\rangle}\end{array}
p
j
S=\textsf{Stabs}(\Pi)=\{ P_{i}\}
N\to\infty
a_{1}
\ddot{\mathrm{~o~}}
c=(m^{2}+n^{2})^{2},
R
d_{n}
x
F_{3}
96\%
G_{F}
(x,y)\in\left[-10,10\right]
x_{0}=x^{u}
V(t)
s_{\mathrm{im}}^{2}\left(a_{1110}+a_{2001}-s_{\mathrm{im}}a_{2100}\right)
r<R_{\mathrm{phot}}
\rho
\overrightarrow{\xi}
\phi(t)
15.5H\times 4.5H\times 4H=6.2\times 1.8\times 1.6m^{3}
p_{L}
\sigma(r)=\frac{2E}{1+\nu}\frac{h\kappa}{4\pi r^{3}}
0
k^{2}=k_{x}^{2}+k_{y}^{2}
\frac{d\rho}{dt}=-[\overline{{F}},\rho]\neq 0.
\leq
({\hat{T}}(\mathbf{x}))^{-1}\mathbf{\hat{r}}{\hat{T}}(\mathbf{x})=\mathbf{\hat{r}}+\mathbf{x}{\hat{\mathbb{I}}}
C_{\mathrm{G}}\approx 16\: \mathrm{\ muF/cm^{2}}
^*
i
{\cal Z}_{B}=Tr\; e^{-\beta\varepsilon_{\kappa}(\overline{{{\Phi}}}_{1,\kappa}\Phi_{1,\kappa}+\overline{{{\Phi}}}_{2,\kappa}\Phi_{2,\kappa})}e^{-\beta\mu(N_{1,\kappa}+N_{2,\kappa})},
\begin{array}{r}{\xi\cos\theta_{\mathrm{L}}+\Delta\sin\theta_{\mathrm{L}}=\sqrt{\xi^{2}+\Delta^{2}}.}\end{array}
I-V
\mu\mathrm{m}
{\frac{\partial a_{k}^{s}}{\partial t}}=\frac{i\epsilon}{8k_{\perp}}\int_{\mathbb{R}^{6}}\sum_{s_{p}s_{q}}\left[s_{p}s_{q}k_{\perp}^{2}+\frac{k_{\parallel}}{pq}\left(p_{\parallel}q^{2}+q_{\parallel}p^{2}\right)\right.
\delta
\mathrm{mwnv}=\int_{-1}^{1}u_{2}(0,x_{2})dx_{2}
\overline{{\v x}}_{k}^{f}=\frac{1}{N_{e}}\sum_{n=1}^{N_{e}}\v x_{k}^{f,(n)}
G_{xx}(0,0)=g(\rho R^{2},\infty)/N
a_{P}a_{Q}^{\dagger}=S_{PQ}-a_{Q}^{\dagger}a_{P},
\leftarrow c_{n-1}\cdot
\begin{array}{rl}{(\pi_{C|D}-\pi_{D|D})q_{D|D}=}&{\left[-c+w_{I}b+\frac{1-w_{I}}{k}(k-1)q_{C|C}b-\frac{1-w_{I}}{k}(k-1)q_{C|D}b\right]\left(1-\frac{k-2}{k-1}p_{C}\right)}\\ {=}&{\left(-c+w_{I}b+\frac{1-w_{I}}{k}b\right)\left(1-\frac{k-2}{k-1}p_{C}\right),}\end{array}
{\begin{array}{rl}{{F^{\alpha\beta}}_{;\beta}}&{=0}\\ {F_{[\alpha\beta;\gamma]}}&{={\frac{1}{3}}\left(F_{\alpha\beta;\gamma}+F_{\beta\gamma;\alpha}+F_{\gamma\alpha;\beta}\right)={\frac{1}{3}}\left(F_{\alpha\beta,\gamma}+F_{\beta\gamma,\alpha}+F_{\gamma\alpha,\beta}\right)=0.}\end{array}}
\begin{array}{rlr}{\sum_{i}P_{i,\nu}dQ_{i,\nu}}&{{}=}&{\frac{1}{2}\left[(P_{k}-P_{-k})d(Q_{k}-Q_{-k})-(Q_{k}+Q_{-k})d(P_{k}+P_{-k})\right]=}\end{array}
\varphi_{1}
R_{1}
F=\frac{v_{x}^{2}+v_{y}^{2}}{2g}.
\pm 2\%
F_{r{\tilde{\theta}}}^{1}=-\, \frac{1}{2\lambda}\, {\dot{a}}~~,~~F_{r{\tilde{\varphi}}}^{2}=\frac{1}{2\lambda}\, {\sin{\widetilde{\theta}}\, {\dot{a}}}~~,~~F_{{\tilde{\theta}}{\tilde{\varphi}}}^{3}=\frac{1}{2\lambda}\, {\sin{\widetilde{\theta}}}\left(1-a^{2}\right)~~.
s\gg\lambda
\operatorname{archavercos}(y)=2\operatorname{arccos}\left({\sqrt{y}}\right)=\operatorname{arccos}\left(2y-1\right)
x={\frac{-2t^{2}-1}{-t^{2}-1}}\qquad\ dx={\frac{2t}{(-t^{2}-1)^{2}}}\, \ dt,
g({\mathsf{d}})=0
T^{2}
\sin(\theta)=-X_{3}
(\mathfrak{n}^{+}\otimes\mathbb C[t])v_{\pmb{\xi}}=0,\quad\, (h_{\alpha_{i}}\otimes t^{s})v_{\pmb{\xi}}=\lambda(h_{\alpha_{i}})\delta_{s,0}v_{\pmb{\xi}},\quad\, (x_{\alpha_{i}}^{-}\otimes 1)^{\lambda(h_{\alpha_{i}})+1}v_{\pmb{\xi}}=0,\quad\, \mathrm{for}\, i=1,2,
\sigma^{\perp}=61.2\mathrm{~m~}
>
^1
\frac{\partial\langle\hat{\mathcal{L}}\rangle}{\partial\mu}=(\langle\hat{A}\rangle-a)\equiv 0,
C_{1}=a(I-P^{T})^{\dag}
\Phi={\left\{ \begin{array}{ll}{\tan{\frac{\pi\alpha}{2}}}&{{\mathrm{if~}}\alpha\neq 1}\\ {-{\frac{2}{\pi}}\log|c\, t|}&{{\mathrm{if~}}\alpha=1}\end{array}\right.}
2n_{\mathrm{ink}}h\cos{\theta_{i}}=m\lambda,
\mathrm{Nu}^{*,(drop)}<-2
s
\begin{array}{r}{4\pi+\frac{\gamma\varepsilon^{3}}{2}(1+\varepsilon+\varepsilon^{2})-\left(\frac{2\pi{h^{\ast}}^{4}}{\varepsilon^{2}}-\frac{\gamma{h^{\ast}}^{2}\varepsilon^{2}}{2}\right)\log{(h^{\ast})}+\ensuremath{\operatorname{O}\left(\gamma\varepsilon^{6},(\gamma+1){h^{\ast}}^{2}\varepsilon^{2},\frac{{h^{\ast}}^{4}}...
v
a_{\mu}^{\mathrm{SUSY}}={\frac{\tan\beta}{48\pi}}{\frac{m_{\mu}^{2}}{M_{\mathrm{SUSY}}^{2}}}(5\alpha_{2}+\alpha_{1})
\tilde{\Omega}
E_{c}
\Gamma(p)\rightarrow\Gamma(p^{\prime})=\Lambda\Gamma(p)\Lambda^{-1}
+{\frac{1}{2m^{2}}}\Pi_{\psi}^{2}+A_{0}\Pi_{\psi}+{\frac{m^{2}}{2}}((\partial_{i}\psi)^{2}+2A_{i}\partial_{i}\psi).
y_{0}=|H(\mathrm{j}\omega)|
\phi=0
\begin{array}{rlr}{V(x,t)}&{=}&{\frac{1}{|\sqrt{2\lambda}\alpha_{0}|^{2q}}\sum_{m=0}^{q}(-1)^{m+q}\frac{(2^{m}q!)^{2}}{(2m)!(q-m)!}\lambda^{q-m}x^{2m}}\\ &{}&{-\frac{(-i)^{q}}{|\sqrt{2\lambda}\alpha_{0}|^{2q}}\Big[\Big(e^{-i\tau}\alpha_{0}\sqrt{2\lambda}\Big)^{q}+\Big(e^{i\tau}\alpha_{0}^{*}\sqrt{2\lambda}\Big)^{q}\Big...
BW=15
{\mathcal{K}}(\hat{M}_{f},\hat{M}_{b})=\mathrm{const}\; \int{\mathcal{D}}{\mathcal{F}}{\mathcal{D}}{\mathcal{B}}\exp\left\{ -{\mathcal{W_{F}}}-{\mathcal{W_{B}}}-{\mathcal{W_{FB}}}\right\}
\begin{array}{rlr}{E_{12}(a,c,W\rightarrow 0)}&{{}=}&{\left\{ \begin{array}{lcl}{-\frac{1}{2}\cos 2\theta}&{,}&{d=0}\\ {\frac{\pi}{4}\sin 2\theta\cos 2\theta-\cos 2\theta+\ln[|\tan\theta|^{\sin^{2}2\theta/2}]}&{,}&{d=2}\\ {-\cos 2\theta}&{,}&{d=4}\\ {-\frac{1}{2}\cos 2\theta\left[1+24(19+5\cos 4\theta)^{-1}\right]}&{,}...
\lambda=L/H
U
\begin{array}{rlr}&{}&{\left.\frac{\partial}{\partial b}\left\{ I(u,v)\right\} \right|_{b=0}}\\ &{=}&{-j\left[\int_{0}^{2\pi}\int_{0}^{1}e^{j[aZ_{5}(r,\theta)-2\pi\rho rcos(\phi-\theta)}rdrd\theta\right.}\\ &{}&{\times\int_{0}^{2\pi}\int_{0}^{1}Z_{4}(r,\theta)e^{-j[aZ_{5}(r,\theta)-2\pi\rho rcos(\phi-\theta)}rdrd\theta...
n_{g}=v_{g}/c
f=1,2
\mathcal{W}
|\mathscr{W}|=-2
H^{2}(\mathrm{~\boldmath~q~}^{(1)},\mathrm{~\boldmath~q~}^{(2)})=\frac{1}{2}\sum_{j}\left(\sqrt{q_{j}^{(1)}}-\sqrt{q_{j}^{(2)}}\right)^{2},
\neg(A\land B)
\forall^{p}L:=\left\{ x\in\{ 0,1\} ^{*}\ \left|\ \left(\forall w\in\{ 0,1\} ^{\leq p(|x|)}\right)\langle x,w\rangle\in L\right.\right\}
\frac{dn_{i}}{dt}=\frac{\partial n_{i}}{\partial t}+\triangledown\cdot(D\triangledown n_{i})=\frac{\delta n_{i}}{\delta t},
\mathcal{H}=-J\sum_{\langle ij\rangle}\pmb{\sigma}_{i}\pmb{\sigma}_{j},
\ldots
^{\circ}
1\%
m=1
u(t)
End of preview. Expand in Data Studio

Synthetic LaTeX OCR Dataset

Dataset Type Format License

Overview

This dataset contains synthetically generated LaTeX formula images designed to augment training data for LaTeX OCR models. The dataset applies style enrichment techniques to existing real-world LaTeX datasets, creating diverse visual representations of mathematical formulas through PDF-rendering and font styling.

Dataset Structure

synth/
├── plain/
│   ├── train/
│   │   ├── images/
│   │   │   ├── train_0000000.png
│   │   │   ├── train_0000001.png
│   │   │   └── ...
│   │   └── metadata.jsonl
│   └── validation/
│       ├── images/
│       └── metadata.jsonl
├── styled/
│   ├── train/
│   │   ├── images/
│   │   └── metadata.jsonl
│   └── validation/
│       ├── images/
│       └── metadata.jsonl
└── README.md

Data Format

Each metadata.jsonl file contains one JSON object per line:

{"text": "x^2 + y^2 = z^2", "file_name": "images/train_0000001.png"}
{"text": "\\frac{a}{b} + \\frac{c}{d}", "file_name": "images/train_0000002.png"}
{"text": "\\int_{0}^{\\infty} e^{-x} dx", "file_name": "images/train_0000003.png"}

Fields:

  • text (str): LaTeX formula string
  • file_name (str): Relative path to the image file

Dataset Statistics

Plain Dataset

Split Samples Avg Length Median Length Min Length Max Length Std Length P95 Length P99 Length
Train 1,143,025 86.1 chars 35.0 chars 1 chars 7,058 chars 142.3 chars 341.0 chars 651.0 chars
Validation 30,461 136.4 chars 60.0 chars 1 chars 3,257 chars 195.1 chars 490.0 chars 894.0 chars
Total 1,173,486 - - - - - - -

Styled Dataset

Split Samples Avg Length Median Length Min Length Max Length Std Length P95 Length P99 Length
Train 154,616 75.0 chars 49.0 chars 10 chars 3,111 chars 80.9 chars 237.0 chars 367.0 chars
Validation 4,133 98.1 chars 71.0 chars 10 chars 845 chars 87.6 chars 291.4 chars 400.0 chars
Total 158,749 - - - - - - -

Combined Statistics

  • Total Plain Dataset: 1,173,486 samples
  • Total Styled Dataset: 158,749 samples
  • Grand Total: 1,332,235 samples

Dataset Constitution

This synthetic dataset is generated from the following sources:

Distribution

image

1. Source Datasets

UniMER-1M

  • Description: Large-scale mathematical expression recognition dataset
  • Source: UniMER-1M training set
  • Formulas: XXX,XXX mathematical expressions
  • Coverage: Diverse mathematical notation including algebra, calculus, geometry, and advanced mathematics

pix2tex Dataset

  • Description: HuggingFace pix2tex LaTeX OCR dataset
  • Source: Loaded automatically from HuggingFace Hub
  • Splits: Training + Validation splits
  • Formulas: LaTeX expressions from academic sources
  • Coverage: Academic papers, textbooks, and research documents

2. Synthetic Plain Dataset

Generation Method: PDF-style rendering without font styling

  • Formula Source: Combined UniMER-1M + pix2tex datasets
  • Processing:
    • Sanitized formulas with comprehensive space normalization
    • Normalized legacy LaTeX commands (\bf\mathbf, etc.)
    • Rendered using MathJax + CairoSVG pipeline (LaTeX → SVG → PDF → PNG)
    • Rasterized at 150 DPI for screenshot-style images
    • RGB format with white background
  • Train/Validation Split: Train from unimer_train + pix2tex_train; Validation from unimer_test + pix2tex_val
  • Usage in Training: 20% random subset used in mixed training dataset

Characteristics:

  • Clean, PDF-quality rendering
  • Consistent font style (default LaTeX fonts)
  • Minimal visual variation
  • Serves as baseline/anchor for style robustness

3. Synthetic Styled Dataset

Generation Method: Style-enriched PDF rendering with font macros

  • Formula Source: Combined UniMER-1M + pix2tex datasets
  • Style Injection Strategy (Section 3.2):
    • Random injection of \mathxx font macros (\mathbf, \mathbb, \mathcal, \mathit, \mathrm, \mathsf, \mathtt, \mathfrak, \mathscr)
    • Semantic heuristics for variable types:
      • Sets (R, C, N, Z, Q): 35% \mathbb, 15% \mathcal, 50% plain
      • Vectors (x, y, z, u, v, w, A, B, M): 30% \mathbf, 10% \mathit, 60% plain
      • Operators (d, e, i): 20% \mathrm, 80% plain
      • Generic: 2% each specialty font, 90% plain
    • Global cap: ~40% of identifiers styled per formula
    • Consistency rule: Same variable gets same style throughout formula
  • Styled Formula Ratio: ~10-50% of original formulas produce distinct styled variants
  • Rendering: MathJax with full TeX package support (amsmath, amssymb, mathrsfs, amsfonts)
  • Train/Validation Split: Train from unimer_train + pix2tex_train; Validation from unimer_test + pix2tex_val
  • Usage in Training: 100% used in mixed training dataset

Characteristics:

  • Rich visual diversity in mathematical typography
  • Realistic font variations from academic publications
  • Maintains semantic correctness
  • Improves model robustness to font styling

Generation Pipeline

Pipeline Steps

  1. Extract Formulas: Extract LaTeX formulas from UniMER and pix2tex source datasets
  2. Sanitize Formulas: Apply LaTeX normalization rules for robust tokenization
  3. Inject Macros & Render: Generate styled variants and render images via MathJax

Technical Details

  1. Style Injection: Probability-based identifier selection with semantic heuristics
  2. Rendering: MathJax (Node.js) for LaTeX → SVG conversion with full TeX package support
  3. Rasterization: CairoSVG for SVG → PDF conversion, then PDF → PNG at 150 DPI

Rendering Pipeline

LaTeX Formula → MathJax (SVG) → CairoSVG (PDF) → pdf2image (PNG)

Source Dataset Citations

@inproceedings{unimer2024,
  title={UniMER: Universal Mathematical Expression Recognition},
  author={UniMER Authors},
  booktitle={Conference},
  year={2024}
}

@dataset{latex_ocr_dataset,
  title={LaTeX-OCR Dataset},
  author={lukbl},
  year={2023},
  publisher={HuggingFace},
  howpublished={\url{https://huggingface.co/datasets/lukbl/LaTeX-OCR-dataset}}
}

License

This dataset is released under the MIT License. See source dataset licenses for additional restrictions:

  • UniMER-1M: [Original License]
  • LaTeX-OCR Dataset: [Original License]

The synthetic generation code and methodology are provided under MIT License.

Changelog

Version 2.0.0 (Formula Sanitization)

  • 🔧 Added LaTeX formula sanitization with comprehensive space normalization rules:

    • Control word boundary protection: Prevents token merging (e.g., \mathcal A stays as \mathcal A)
    • Text-like command preservation: Maintains spaces in \text{}, \mathrm{}, \operatorname{}, etc.
    • Control symbol handling: Preserves spaces after control symbols (\,, \;, \\, etc.)
    • Verbatim command exemption: \verb and \lstinline commands remain untouched
    • Array/tabular optimization: Removes unnecessary spaces around & and \\ in structured environments
    • General space cleanup: Removes all other redundant whitespace
  • 📈 Improved formula consistency and reduced tokenization errors

    Example:

    Old:  \mathcal  A  +  \text{ cost }  +  \begin{array}{c} x \\ y \end{array}
    New: \mathcal A+\text{ cost }+\begin{array}{c}x\\y\end{array}
    

Version 1.0.0 (Initial Release)

  • ✨ Initial release with plain and styled variants
  • ✨ HuggingFace JSONL format
  • ✨ Train/validation splits (90/10)
  • ✨ Quality-controlled generation pipeline
  • 📊 Total samples: 1,332,235 (Plain: 1,173,486 | Styled: 158,749)
Downloads last month
18

Models trained or fine-tuned on PadishahIIIXXX/latex-ocr-dataset