Skip to content

Fix numbering of several footnotes in one callout in LaTeX output - #15412

Open
chanellebingham wants to merge 1 commit into
quarto-dev:mainfrom
chanellebingham:fix-15299-callout-footnote-numbers
Open

chanellebingham wants to merge 1 commit into
quarto-dev:mainfrom
chanellebingham:fix-15299-callout-footnote-numbers

Conversation

@chanellebingham

@chanellebingham chanellebingham commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #15299

Description

When a callout has more than one footnote, the PDF prints all of them at the bottom of the page with the callout's last number. On the test page the notes came out as 1, 2, 5, 5, 5 instead of 1, 2, 3, 4, 5.

Inside a callout, footnotes are written as \footnotemark, with their text added after the box using \footnotetext. Each mark steps the footnote counter, and \footnotetext uses wherever the counter is at, so every text got the last number. This rewinds the counter to the first mark, then steps it before each of the other texts. A callout with a single footnote is unchanged.

The numbers were checked in a rendered PDF for default, simple (with and without an icon) and minimal callouts. The new smoke test fails on main and passes here.

Some rarer cases are not fixed here and are also wrong on main, so they are left for separate issues:

  • clicking a footnote mark in the PDF can jump to the wrong note (hyperref's anchors)
  • callouts inside a layout panel
  • a footnote inside a footnote, in a repeated table header, or in a figure caption
  • reference-location: margin

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes (the new test passes, and the other callout smoke tests with LaTeX or PDF output give the same results as main. That includes the 2 tufte.qmd cases, which don't finish on either because lualatex hangs on this machine; the LaTeX it receives is byte-identical on both. The full suite also needs Python and Julia, which aren't installed here.)
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR (not applicable: no documented behaviour changes)
AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

Footnotes inside a callout become \footnotemark, with their text written
after the box using \footnotetext. Each mark steps the footnote counter and
a plain \footnotetext uses its current value, so every text got the last
mark's number. Rewind the counter to the first mark and step it before each
following text.

Fixes quarto-dev#15299
@posit-snyk-bot

posit-snyk-bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Footnotes inside callouts are misnumbered, only at bottom of page

2 participants