Skip to content

bug: UF-F3 false-positive must-fix on figure/table pages (modal glyph size ≠ body-text size) #82

Description

@YuZh98

Summary

UF-F3 (PDF layer) emits must-fix findings on pages that are dominated by a float (a full-page table or a figure with sub-captions), mislabeling the float's intentionally smaller caption/cell font as undersized "body text". These are false positives: UF Graduate School accepts \footnotesize tables and \small figure sub-captions in practice.

Root cause

_extract_pages computes body_size as the modal glyph size on the page (most common round(char.size, 1) by glyph count), excluding only math/monospace fonts:

  • latex2ufdissertation/pipeline/pdf_checks.py:122-163body_size = max(size_counter...)
  • latex2ufdissertation/pipeline/pdf_checks.py:202-230_check_f3 flags must-fix when abs(body_size - 12.0) > 0.5

On a page whose content is mostly a float, the modal size is the caption/table-cell font, not running body text. The page then reports e.g. 10.9pt body text (a \small sub-caption ≈ 10.95pt) or 10.0pt body text (a \footnotesize table), even though the page contains little or no actual 12-point body text. The heuristic conflates "most common glyph size on the page" with "body text size"; it has no notion of float vs. body content (unlike the math/mono exclusion at line 152).

Reproduction

  1. A real UF dissertation (accepted by the Graduate School on first submission) with:
    • two appendix tables wrapped \begin{table}[H]\footnotesize
    • several figures whose subcaption sub-captions render at \small
  2. latex2ufdissertation --main exampleMasterFile.tex .
  3. Observed:
    [must-fix] UF-F3 p.42  — 10.9pt body text
    [must-fix] UF-F3 p.118 — 10.9pt body text
    [must-fix] UF-F3 p.122 — 10.9pt body text
    [must-fix] UF-F3 p.125 — 10.0pt body text
    [must-fix] UF-F3 p.126 — 10.0pt body text
    Summary: 5 must-fix, 0 review.
    
    Pages 42/118/122 are figure pages (sub-captions); 125/126 are appendix tables C-2/C-3.
  4. Expected: no must-fix. A page that is entirely a float with a smaller caption/cell font is not a 12-point body-text violation. Real-world evidence: this exact document passed UF review.

Why this matters

The whole point of must-fix is "the Graduate School will reject this." A confirmed-accepted submission flagged with 5 must-fix items means the severity is wrong for this pattern, which erodes trust in the must-fix tier.

Suggested remediations (pick one / combine)

  1. Body-page gating. Only run the F3 size test on pages that contain a meaningful amount of normal running text (e.g. require N≥threshold glyphs at a plausible body size, or require body text to occupy a minimum share of the page). Float-only pages are skipped. A genuine global \fontsize override still trips because it shrinks text-heavy pages too.
  2. Exclude float/caption text from body_size. Treat caption/table content like math/mono — though pdfminer does not tag captions, so this needs a positional heuristic (text inside/adjacent to LTFigure, or short runs beneath a figure) and is more fragile than (1).
  3. Severity split. Demote the PDF-layer F3 to review for pages where the deviating size is not the document-wide modal size (i.e. localized to a float page), reserving must-fix for a document-wide body shrink (deviation on the majority of text pages).

Option 1 is the most robust and matches the documented intent (catch a global 12-point override, per the comment at lines 38-41).

Environment

  • latex2ufdissertation --version: 0.3.2
  • Python: 3.13.13
  • OS: macOS (Darwin 25.5.0)
  • Layer: PDF (toolchain-independent; reproduces from the compiled PDF alone)

Additional context

Source-layer F3 already emits at review for localized \fontsize (see docstring at pdf_checks.py:211-214); the PDF layer is the half emitting the false must-fix. Related: #58 (PDF-layer F3 boundary coverage), #57 (p.N sort).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions