latex-display-layout-audit
Skill5 starsChanged 56 days agoMITView on GitHub
Compare display-math layout in a LaTeX AI or mathematics translation with the original PDF and repair confirmed wrapping, alignment, nesting, or OCR spacing defects while preserving equation numbers and labels.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- VesperaZephyr/agent-skillstheir own version, first seen Nov 29, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- VesperaZephyr/agent-skills★ 7same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- aimath-translations-skillSkill
- latex-array-diagram-auditSkill
- latex-bookmark-anchor-auditSkill
- latex-eq-numbering-auditSkill
- latex-footnote-fidelity-auditSkill
- latex-ocr-math-defect-auditSkill
- latex-translation-fidelity-auditSkill
- math-pdf-bookmarkSkill
- mathtranslation-build-verifySkill
- mathtranslation-cls-v31-upgradeSkill
- mathtranslation-hardrefSkill
- pdf-scanned-ocr-bookmarkSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use when a displayed formula looks excessively wrapped, misaligned, nested incorrectly, or affected by OCR spacing.
- Distinctive: line 22
If images cannot be inspected, report the limitation and use measurements without claiming a visual comparison.
- Very specific: line 40
Before editing, record the label-to-printed-number map from .aux, including custom \tag, starred environments, and per-row \notag behavior.
- Very specific: line 49
Do not replace an environment blindly merely because a scanner finds nesting.
- Very specific: line 68
Verify the spelling against the original before changing Hilbert - Schmidt or similar prose inside \text{...}.
- Very specific: line 77
Only supply an exact --term after checking its spelling and spacing on the source page.
- Distinctive: line 78
Do not apply a prose spacing rewrite to code or pseudocode operators.
- Distinctive: line 82
Run the project's full build and inspect final logs for errors, unresolved references, missing glyphs, clipping, and remaining rerun …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Display-Math Layout Audit
Use when a displayed formula looks excessively wrapped, misaligned, nested incorrectly, or affected by OCR spacing. Obtain the original page before editing.
Locate And Measure
- Find the source block using a distinctive formula fragment or nearby prose.
- Locate the original page from its heading, number, or text layer; calibrate printed-to-physical page mapping for that PDF. Do not reuse another book's offset.
- Render the original and translated formula regions. Text-layer bounding boxes help locate a formula, but the rendered glyphs determine its appearance.
- Compare logical line count, relation alignment, horizontal centering, and glyph
style.
\Reand italicRe, for example, are not interchangeable. If images cannot be inspected, report the limitation and use measurements without claiming a visual comparison.
Scan For Candidates
From this skill's directory:
python scripts/scan_layout_oddities.py path/to/chaptersThe scanner reports nested math environments and numbered environments whose
rows all carry \notag or \nonumber. Treat these as candidates: an aligned
or split inside a suitable outer display can be valid. All-notag derivations
are often intentional. A leading & alone is not evidence of a defect.
Preserve Numbering During Repairs
Before editing, record the label-to-printed-number map from .aux, including
custom \tag, starred environments, and per-row \notag behavior.
| Source block | Repair constraint |
| Fully unnumbered | Rewrap or regroup without introducing a number. |
| Numbered or labeled | Keep every label, tag, numbered row, and counter effect. |
| Mixed numbered/unnumbered rows | Inspect each row and preserve its number behavior. |
Do not replace an environment blindly merely because a scanner finds nesting.
Fix only the confirmed spacing or break points. Under a MathTranslations template,
use its align family conventions; for other projects preserve their native
display conventions. Never wrap a top-level align/align* inside \[ ... \].
For an unnumbered formula that needs a second line within an align* block:
\begin{align*}
\lambda_1 &= -\alpha - \frac{\varepsilon}{\sqrt{2}}, \\
\lambda_1 &\leq \lambda_2 \leq \cdots \leq \lambda_n.
\end{align*}Choose breaks and alignment from the source's mathematical grouping and the available text width. Do not force the source's line count if it clips the translation.
OCR Hyphen Spacing
Verify the spelling against the original before changing Hilbert - Schmidt
or similar prose inside \text{...}. The helper supports a dry run:
python scripts/fix_hyphen_spacing.py path/to/chapters
python scripts/fix_hyphen_spacing.py path/to/chapters --apply --term "Hilbert - Schmidt"It backs up changed files and preserves existing line endings, including LF. Only supply an exact --term after checking its spelling and spacing on the source page. Do not apply a prose spacing rewrite to code or pseudocode operators.
Build And Compare
- Run the project's full build and inspect final logs for errors, unresolved references, missing glyphs, clipping, and remaining rerun requests.
- Compare the complete label-to-number map before/after; label count alone is insufficient. Recheck index/page references if pagination changed.
- Render repaired formula pages and compare them with the original crops. Source line counts do not measure rendered layout quality.
- Preserve encoding and line endings. Read complete source lines: truncated
output can hide a
\notagand create a false diagnosis. - Report confirmed repairs, remaining candidates, and any tool limitations. Shell or toolchain failures must be diagnosed in the current environment.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

