From c88e6d750847ec9fd571ffadac79e37f27afcc94 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Tue, 8 Oct 2024 12:01:31 -0700 Subject: [PATCH 1/4] typst,tables,pandoc - ask pandoc to not emit crossref environments for tables --- src/resources/filters/quarto-post/typst.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/resources/filters/quarto-post/typst.lua b/src/resources/filters/quarto-post/typst.lua index 57c7927365..347fbf8547 100644 --- a/src/resources/filters/quarto-post/typst.lua +++ b/src/resources/filters/quarto-post/typst.lua @@ -119,6 +119,11 @@ function render_typst_fixups() end return div end, + Table = function(tbl) + -- https://github.com/quarto-dev/quarto-cli/issues/10438 + tbl.classes:insert("typst:no-figure") + return tbl + end, Para = function(para) if #para.content ~= 1 then return nil From d336e8aab657097debebf1a29b3528f994480e19 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Tue, 8 Oct 2024 12:06:48 -0700 Subject: [PATCH 2/4] regression test --- .../docs/smoke-all/2024/10/08/issue-10438.qmd | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/docs/smoke-all/2024/10/08/issue-10438.qmd diff --git a/tests/docs/smoke-all/2024/10/08/issue-10438.qmd b/tests/docs/smoke-all/2024/10/08/issue-10438.qmd new file mode 100644 index 0000000000..4524b77da2 --- /dev/null +++ b/tests/docs/smoke-all/2024/10/08/issue-10438.qmd @@ -0,0 +1,32 @@ +--- +format: + typst: + output-ext: typ +_quarto: + tests: + typst: + ensureFileRegexMatches: + - [] + - ['#figure\(\[\n#figure\('] +--- + +::: {#tbl-main layout-ncol=1} + +| A | B | +|---|---| +| 1 | 2 | +| 3 | 4 | + +: Caption 1 {#tbl-one} + +| 1 | 2 | +|---|---| +| A | B | +| C | D | + +: Caption 2 {#tbl-two} + +Main caption +::: + +See @tbl-main, @tbl-one, @tbl-two. \ No newline at end of file From 34442fd95306faa10479516c1dff5ea169d4f48f Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Tue, 8 Oct 2024 12:07:51 -0700 Subject: [PATCH 3/4] changelog --- news/changelog-1.6.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/news/changelog-1.6.md b/news/changelog-1.6.md index ec24f5d11f..b4c24baa57 100644 --- a/news/changelog-1.6.md +++ b/news/changelog-1.6.md @@ -46,7 +46,8 @@ All changes included in 1.6: - ([#10168](https://github.com/quarto-dev/quarto-cli/issues/10168)): Support `csl` bibliography style. - ([#10181](https://github.com/quarto-dev/quarto-cli/issues/10181)): Remove workaround for image dimensions which is no longer necessary and mishandled image paths with spaces. - ([#10217](https://github.com/quarto-dev/quarto-cli/issues/10217)): Explicitly compute units for image dimensions in `typst` format when they're not given. -- ([#10212](https://github.com/quarto-dev/quarto-cli/issues/10212)): Moves Pandoc variables to the function declaration for the default template. +- ([#10212](https://github.com/quarto-dev/quarto-cli/issues/10212)): Move Pandoc variables to the function declaration for the default template. +- ([#10438](https://github.com/quarto-dev/quarto-cli/issues/10438)): Ensure Pandoc doesn't emit its own crossref environments for table elements. ## `latex` and `pdf` Format From 3f1cb055f3b5725804d7df02dd15170e5b75adef Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Tue, 8 Oct 2024 12:23:05 -0700 Subject: [PATCH 4/4] update tests --- tests/docs/smoke-all/2024/04/26/9365.qmd | 4 ++-- tests/docs/smoke-all/typst/tbl-align-issue10086.qmd | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/docs/smoke-all/2024/04/26/9365.qmd b/tests/docs/smoke-all/2024/04/26/9365.qmd index d5b36bef45..6e4416e497 100644 --- a/tests/docs/smoke-all/2024/04/26/9365.qmd +++ b/tests/docs/smoke-all/2024/04/26/9365.qmd @@ -10,8 +10,8 @@ _quarto: - [] typst: ensureTypstFileRegexMatches: - - ['[\s]*#figure\('] - - ['[\s]*#block\[[\s]*#figure\('] + - ['[\s]*#table\('] + - ['[\s]*#block\[[\s]*#table\('] --- # Test table {#test-table} diff --git a/tests/docs/smoke-all/typst/tbl-align-issue10086.qmd b/tests/docs/smoke-all/typst/tbl-align-issue10086.qmd index bbfc420a32..79f42e70a0 100644 --- a/tests/docs/smoke-all/typst/tbl-align-issue10086.qmd +++ b/tests/docs/smoke-all/typst/tbl-align-issue10086.qmd @@ -8,7 +8,7 @@ _quarto: typst: ensureTypstFileRegexMatches: - - ['#figure\(\[(\r\n?|\n)#figure'] + ['#figure\(\[(\r\n?|\n)#table'] - ['#block\[(\r\n?|\n)#figure\(\[(\r\n?|\n)#block\[(\r\n?|\n)#figure'] ---