Skip to content

Commit

Permalink
Merge pull request #11180 from quarto-dev/bugfix/10001
Browse files Browse the repository at this point in the history
layout,float - use correct *-pos attribute for non-fig floats
  • Loading branch information
cscheid authored Oct 23, 2024
2 parents 54beb20 + d56758b commit b1e5d9c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/changelog-1.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion src/resources/filters/layout/latex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 31 additions & 0 deletions tests/docs/smoke-all/2024/10/23/issue-10001.qmd
Original file line number Diff line number Diff line change
@@ -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
:::

0 comments on commit b1e5d9c

Please sign in to comment.