diff --git a/news/changelog-1.10.md b/news/changelog-1.10.md index d5da8ded432..2982306d7e7 100644 --- a/news/changelog-1.10.md +++ b/news/changelog-1.10.md @@ -9,6 +9,10 @@ All changes included in 1.10: ## Formats +### `pdf` + +- ([#13588](https://github.com/quarto-dev/quarto-cli/issues/13588)): Fix Lua error when rendering PDF with `reference-location: margin` and a footnote alongside a figure with `fig-cap`. (author: @mcanouil) + ### `typst` - ([#14261](https://github.com/quarto-dev/quarto-cli/issues/14261)): Fix theorem/example block titles containing inline code producing invalid Typst markup when syntax highlighting is applied. diff --git a/src/resources/filters/quarto-post/latex.lua b/src/resources/filters/quarto-post/latex.lua index 11f18f296fe..3febbfc6a7d 100644 --- a/src/resources/filters/quarto-post/latex.lua +++ b/src/resources/filters/quarto-post/latex.lua @@ -478,7 +478,7 @@ function render_latex() Note = function(n) if marginReferences() then -- This is to support multiple paragraphs in footnotes in margin as sidenotes CTAN has some issue (quarto-dev/quarto-cli#7534) - n.content = pandoc.Para(pandoc.utils.blocks_to_inlines(n.content, {pandoc.RawInline('latex', '\n\\endgraf\n')})) + n.content = pandoc.Blocks({pandoc.Para(pandoc.utils.blocks_to_inlines(n.content, {pandoc.RawInline('latex', '\n\\endgraf\n')}))}) return n end end diff --git a/tests/docs/smoke-all/2026/04/30/13588.qmd b/tests/docs/smoke-all/2026/04/30/13588.qmd new file mode 100644 index 00000000000..95c79e3e0d0 --- /dev/null +++ b/tests/docs/smoke-all/2026/04/30/13588.qmd @@ -0,0 +1,22 @@ +--- +title: footnote and fig-cap with reference-location margin in PDF (#13588) +format: pdf +reference-location: margin +_quarto: + tests: + pdf: null + latex: + ensureFileRegexMatches: + - ['This is a footnote'] + - [] +--- + +A footnote[^1] and a figure. + +[^1]: This is a footnote. + +```{r} +#| fig-cap: Some figure + +plot(1:10, 1:10) +```