Repository navigation
fix: drop footnote marks after captions and crop figures printed under their caption - #89
Merged
Merged
Conversation
…r their caption
jmir-chatmind-rct had two caption gaps.
- A superscript footnote mark after a caption's last sentence ("effects.a")
was kept as caption text. Trailing spans that PyMuPDF flags as
superscript, three characters at most, are now left out when the text
before them ends a sentence. Table 2's "study groups.e" is fixed too.
- Figure 1's caption sits above the CONSORT diagram. With no visual above
the caption, the crop fell back to the page-header strip, and the quality
gate rejected it. A caption with no visual above it now takes a figure
that starts within 24pt below it, unless that figure ends at a caption of
its own.
- Removes both jmir-chatmind-rct known gaps.
On all 34 corpus papers, captions and crops change only for
jmir-chatmind-rct.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moses-y
pushed a commit
to moses-y/DeepPaperNote
that referenced
this pull request
Nov 12, 2026
A table caption can mark the abbreviations it uses, as in jmir-chatmind-rct Table 2: "anxiety (GAD-7a), depression (ODSISb)", where each raised letter points to a note below the table. 917Dhj#89 dropped only marks after a caption's last sentence, so these stayed in the caption as "GAD-7a". A superscript span of lowercase letters ("a" or "a,b") is now left out when it follows a token with two or more capitals. Raised variables such as the "l" of "h" + "l", a single capital such as "W" + "q", and raised digits stay. On all 34 corpus papers (454 captions), only that caption changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two caption gaps in
jmir-chatmind-rct.Footnote mark after the caption (
pdf_captions.py)effects.abecomeseffects.. Superscripts that don't follow a sentence end (cm2,GAD-7a) are kept.Caption printed above its figure (
extract_pdf_assets.py)Evidence
jmir-chatmind-rct:caption:Table 3XFAIL (…effects.a);review:Figure 1XFAIL (crop[0, 0, 595, 65], rejectlow_visual_body_ratio)After: both XPASS(strict), so both gaps are removed. Figure 1 is cropped at
[73, 83, 523, 776], usable, and reaches Visual Review.test_footnote_mark_after_the_caption_sentence_is_not_caption_text(a,*,†, and a keptcm2),test_caption_above_its_figure_crops_the_figure_below,test_caption_with_no_visual_above_leaves_the_next_captioned_figure_alonepython3 -m pytest -q: 1706 passed, 1 skippedpython3 -m pytest -q -m corpus: 367 passed, 22 xfailed (baseline 365 / 24; no other gap flipped)jmir-chatmind-rctchanges: Figure 1's crop, Table 3's caption, and Table 2's caption (study groups.ebecomesstudy groups.). Table crop bboxes are unchanged.Merge Danger
Door: two-way
No artifact schema change. A revert restores the old output.
Blast Radius: narrow
The below-caption path runs only for figure captions with no visual above them. The footnote rule only touches trailing superscript spans after a sentence end. Superscript marks in the middle of a caption (
GAD-7a) are still kept as text, which is out of scope here.🤖 Generated with Claude Code