From 948d25995b4f6a9dc1e33a7ba2de03363a43c684 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 13 Nov 2023 13:14:48 +0100 Subject: [PATCH 1/2] Patch Footnotes when in margin to support multiple paragraph As it seems sidenotes CTAN package has an issue and does not handle it correctly, unless using a specific syntax --- src/resources/filters/quarto-post/latex.lua | 9 ++++++++- tests/docs/smoke-all/2023/11/13/7534.qmd | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 tests/docs/smoke-all/2023/11/13/7534.qmd diff --git a/src/resources/filters/quarto-post/latex.lua b/src/resources/filters/quarto-post/latex.lua index 608b4281ed..29e6e8e4ce 100644 --- a/src/resources/filters/quarto-post/latex.lua +++ b/src/resources/filters/quarto-post/latex.lua @@ -376,7 +376,14 @@ function render_latex() end return pandoc.Div(calloutContents) - end + end, + 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')})) + return n + end + end } end diff --git a/tests/docs/smoke-all/2023/11/13/7534.qmd b/tests/docs/smoke-all/2023/11/13/7534.qmd new file mode 100644 index 0000000000..71f4695029 --- /dev/null +++ b/tests/docs/smoke-all/2023/11/13/7534.qmd @@ -0,0 +1,17 @@ +--- +title: multiple paragraph in footnotes (#7534) +reference-location: margin +_quarto: + tests: + pdf: null + latex: + ensureFileRegexMatches: + - ['The first paragraph\.[\s\S]+\\endgraf[\s\S]+The second paragraph'] + - [] +--- + +Some text.[^note] Some more text. + +[^note]: The first paragraph. + + The second paragraph. From ab1fa7a577f506b3f2d9fb010f5f6e189941e4fd Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 13 Nov 2023 14:41:32 +0100 Subject: [PATCH 2/2] Add to changelog [skip ci] --- news/changelog-1.4.md | 1 + 1 file changed, 1 insertion(+) diff --git a/news/changelog-1.4.md b/news/changelog-1.4.md index bc3bec6436..25821e73db 100644 --- a/news/changelog-1.4.md +++ b/news/changelog-1.4.md @@ -66,6 +66,7 @@ - ([#6990](https://github.com/quarto-dev/quarto-cli/issues/6990)): Fix an issue where underscore in `filename` code cell attribute were not escaped. - ([#7175](https://github.com/quarto-dev/quarto-cli/issues/7175)): Fix an issue with code annotations when more than one digit is used for annotation number. - ([#7267](https://github.com/quarto-dev/quarto-cli/issues/7267)): Fix issue with longtable environments interfering with the `table` counter. +- ([#7534](https://github.com/quarto-dev/quarto-cli/issues/7534)): Fix issue with multiple paragraph footnotes when using `reference-location: margin`. ## Docusaurus Format