From 992c3e86b5067991f1d4e05d5cb61888bc6c68d5 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Wed, 23 Oct 2024 15:11:23 -0700 Subject: [PATCH 1/3] layout - resolve layout float type flexibly --- src/resources/filters/layout/latex.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/resources/filters/layout/latex.lua b/src/resources/filters/layout/latex.lua index 1e5a8018ba..6660e70a44 100644 --- a/src/resources/filters/layout/latex.lua +++ b/src/resources/filters/layout/latex.lua @@ -81,7 +81,11 @@ function latexPanelEnv(layout) -- defaults local env = latexFigureEnv(layout) - local pos = attribute(layout.float or { attributes = layout.attributes or {} }, kFigPos) + local attr_key = kFigPos + if layout.float then + attr_key = ref_type_from_float(layout.float) .. "-pos" + end + local pos = attribute(layout.float or { attributes = layout.attributes or {} }, attr_key) return env, pos end From e23a9257042e35bd1c2564cf36203854eab83277 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Wed, 23 Oct 2024 15:11:37 -0700 Subject: [PATCH 2/3] regression test --- .../docs/smoke-all/2024/10/23/issue-10001.qmd | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/docs/smoke-all/2024/10/23/issue-10001.qmd diff --git a/tests/docs/smoke-all/2024/10/23/issue-10001.qmd b/tests/docs/smoke-all/2024/10/23/issue-10001.qmd new file mode 100644 index 0000000000..5fab390514 --- /dev/null +++ b/tests/docs/smoke-all/2024/10/23/issue-10001.qmd @@ -0,0 +1,31 @@ +--- +title: "Untitled" +format: latex +_quarto: + tests: + latex: + ensureFileRegexMatches: + - ['\\begin{table}\[H\]'] + - [] +--- + +:::{#tbl-tm2 tbl-pos="H" layout-ncol="2"} + +:::{#tbl-tm2a} +| A | B | C | +|---|---|---| +| 1 | 2 | 3 | + +Table1: +::: + +:::{#tbl-tm2b} +| A | B | C | +|---|---|---| +| 1 | 2 | 3 | + +Table2: +::: + +Not so nice: Where Latex Wants it +::: From d56758bb1463ebf395dc5efc03338938ddb57238 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Wed, 23 Oct 2024 15:13:05 -0700 Subject: [PATCH 3/3] changelog --- news/changelog-1.6.md | 1 + 1 file changed, 1 insertion(+) diff --git a/news/changelog-1.6.md b/news/changelog-1.6.md index bf90919d29..aa3dd891ea 100644 --- a/news/changelog-1.6.md +++ b/news/changelog-1.6.md @@ -65,6 +65,7 @@ All changes included in 1.6: ## `latex` and `pdf` Format +- ([#10001](https://github.com/quarto-dev/quarto-cli/issues/10001)): Support correct `*-pos` attribute in `FloatRefTarget` nodes with layouts. - ([#10291](https://github.com/quarto-dev/quarto-cli/issues/10291)): Several improvement regarding Quarto LaTeX engine behavior for missing hyphenation log message: - `latex-auto-install: false` now correctly opt out any missing hyphenation packages detection and installation. Only a warning will be thrown if any detected in the log. - For default behavior (`latex-auto-install: true`), detection is still happening and missing packages are installed automatically. If it fails, Quarto does not fail anymore as PDF rendering as succeeded already. Only a warning will be thrown to log the installation failure.