diff --git a/news/changelog-1.6.md b/news/changelog-1.6.md index 0c341c8285..cf66f1ee98 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. 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 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 +:::