Skip to content

Commit b1e5d9c

Browse files
authored
Merge pull request #11180 from quarto-dev/bugfix/10001
layout,float - use correct *-pos attribute for non-fig floats
2 parents 54beb20 + d56758b commit b1e5d9c

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

news/changelog-1.6.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ All changes included in 1.6:
6565

6666
## `latex` and `pdf` Format
6767

68+
- ([#10001](https://github.com/quarto-dev/quarto-cli/issues/10001)): Support correct `*-pos` attribute in `FloatRefTarget` nodes with layouts.
6869
- ([#10291](https://github.com/quarto-dev/quarto-cli/issues/10291)): Several improvement regarding Quarto LaTeX engine behavior for missing hyphenation log message:
6970
- `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.
7071
- 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.

src/resources/filters/layout/latex.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ function latexPanelEnv(layout)
8181

8282
-- defaults
8383
local env = latexFigureEnv(layout)
84-
local pos = attribute(layout.float or { attributes = layout.attributes or {} }, kFigPos)
84+
local attr_key = kFigPos
85+
if layout.float then
86+
attr_key = ref_type_from_float(layout.float) .. "-pos"
87+
end
88+
local pos = attribute(layout.float or { attributes = layout.attributes or {} }, attr_key)
8589

8690
return env, pos
8791
end
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: "Untitled"
3+
format: latex
4+
_quarto:
5+
tests:
6+
latex:
7+
ensureFileRegexMatches:
8+
- ['\\begin{table}\[H\]']
9+
- []
10+
---
11+
12+
:::{#tbl-tm2 tbl-pos="H" layout-ncol="2"}
13+
14+
:::{#tbl-tm2a}
15+
| A | B | C |
16+
|---|---|---|
17+
| 1 | 2 | 3 |
18+
19+
Table1:
20+
:::
21+
22+
:::{#tbl-tm2b}
23+
| A | B | C |
24+
|---|---|---|
25+
| 1 | 2 | 3 |
26+
27+
Table2:
28+
:::
29+
30+
Not so nice: Where Latex Wants it
31+
:::

0 commit comments

Comments
 (0)