gotex-refdiff

command
v0.173.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Command gotex-refdiff is a reference-diff corpus sampler: the highest-signal fidelity detector for gotex. Over a random SAMPLE of a directory of real arXiv papers it compiles each paper twice — once with a real LaTeX engine (tectonic, the ground truth) and once with gotex — extracts the text of both PDFs with pdftotext, and reports a per-paper word-recall ratio: the fraction of the reference's extractable content words that gotex reproduced. The report is ranked worst-first, so the papers where gotex loses the most REAL content against a ground-truth engine surface directly as fix targets.

It is a developer tool, not a CI gate: it needs network (tectonic downloads its package bundle on first use) and poppler's pdftotext. tectonic and pdftotext are taken from PATH when present, else from pkgx. Example:

GOWORK=off go run ./cmd/gotex-refdiff -corpus /path/to/arxiv/work -n 40

The recall ratio is robust to the three known-expected engine differences documented in scripts/fidelity.sh (page numbers, math rendered as vector paths, and the fi/fl ligature ToUnicode gap); see contentWords in analyze.go.

The -layout flag switches to the geometric complement of the recall measure. Recall says WHAT text gotex reproduced; the layout diff says WHERE it landed. It reuses the same corpus sampler, top-level resolution and compile wiring, but extracts per-word bounding boxes with `pdftotext -bbox`, aligns the two word streams by content, and ranks papers worst-first by a layout-divergence score combining matched-word displacement, page-count agreement, and line-break agreement. It masks the same three known differences, so the score reflects REAL layout divergence. See layout.go. Example:

GOWORK=off go run ./cmd/gotex-refdiff -corpus /path/to/arxiv/work -n 40 -layout

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL