Skip to content

fix(pdf/latex): wrap Note content in Blocks list for reference-location margin (#13588)#14464

Merged
cderv merged 1 commit intoquarto-dev:mainfrom
mcanouil:fix/13588-footnote-margin-pdf-lua-error
Apr 30, 2026
Merged

fix(pdf/latex): wrap Note content in Blocks list for reference-location margin (#13588)#14464
cderv merged 1 commit intoquarto-dev:mainfrom
mcanouil:fix/13588-footnote-margin-pdf-lua-error

Conversation

@mcanouil
Copy link
Copy Markdown
Collaborator

@mcanouil mcanouil commented Apr 30, 2026

n.content on a Note element must be a Blocks list, but the handler introduced for #7534 was assigning a bare pandoc.Para(...) (a single Block), causing scopedwalk.lua to crash with attempt to get length of a Block value whenever a footnote appeared alongside a figure with fig-cap in a PDF document using reference-location: margin.

Wrapping the Para in pandoc.Blocks({...}) restores the correct type and preserves the \endgraf behaviour needed for multi-paragraph sidenotes.

Closes #13588

…gin (quarto-dev#13588)

n.content on a Note element must be a Blocks list, but the handler
introduced for quarto-dev#7534 was assigning a bare pandoc.Para (a single Block),
causing scopedwalk.lua to crash with "attempt to get length of a Block
value" whenever a footnote appeared alongside a fig-cap figure in a PDF
document using reference-location: margin.

Wrapping the Para in pandoc.Blocks({...}) restores the correct type and
preserves the \endgraf behaviour needed for multi-paragraph sidenotes.
@mcanouil mcanouil added the bug Something isn't working label Apr 30, 2026
@mcanouil mcanouil self-assigned this Apr 30, 2026
@mcanouil mcanouil changed the title fix(pdf): wrap Note content in Blocks list for reference-location margin (#13588) fix(pdf/latex): wrap Note content in Blocks list for reference-location margin (#13588) Apr 30, 2026
Copy link
Copy Markdown
Member

@cderv cderv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cderv cderv merged commit ff77c43 into quarto-dev:main Apr 30, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error with figure caption and markdown footnote when reference-location: margin and format: pdf

2 participants