Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ All changes included in 1.7:
- ([#11835](https://github.com/quarto-dev/quarto-cli/issues/11835)): Take markdown structure into account when detecting minimum heading level.
- ([#11903](https://github.com/quarto-dev/quarto-cli/issues/11903)): `crossref` configuration like `fig-title` or `tbl-title` now correctly supports multi word values, e.g. `fig-title: 'Supplementary Figure'`.
- ([#11878](https://github.com/quarto-dev/quarto-cli/issues/11878), [#12085](https://github.com/quarto-dev/quarto-cli/issues/12085)): Correctly fixup raw LaTeX table having an unexpected table env with options (e.g `\begin{table}[!ht]`) to be handled as crossref table.
- ([#12344](https://github.com/quarto-dev/quarto-cli/issues/12344)): Ensure decorated code blocks do not float when inside layout elements.
- Update to Pandoc's LaTeX template following Pandoc 3.6.3 support:
- `format: beamer` now uses its own template. The main template for latex does not use `$if(beamer)$` anymore, and the new template for beamer uses the same partials as latex one.
- Improved Babel support:
Expand Down
9 changes: 4 additions & 5 deletions src/resources/filters/customnodes/decoratedcodeblock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,10 @@ _quarto.ast.add_renderer("DecoratedCodeBlock",
-- further, otherwise generate the listing div and return it
if not param("listings", false) then
local listingDiv = pandoc.Div({})
local position = ""
if _quarto.format.isBeamerOutput() then
-- Adjust default float positionment for beamer (#5536)
position = "[H]"
end
-- Adjust default float positionment for beamer (#5536)
-- Adjust default float positionment for code blocks that request it (#12344)
local needs_hold = _quarto.format.isBeamerOutput() or node.hold
local position = needs_hold and "[H]" or ""
listingDiv.content:insert(pandoc.RawBlock("latex", "\\begin{codelisting}" .. position))

local captionContent = node.caption
Expand Down
17 changes: 16 additions & 1 deletion src/resources/filters/customnodes/panellayout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,23 @@ _quarto.ast.add_handler({
-- construct a minimal rows-cells div scaffolding
-- so contents are properly stored in the cells slot

-- #12344: if there are decoratedcodeblocks inside the layout,
-- we need to ask them to render themselves as [H] or we'll get outer par mode errors.
local layout = tbl.layout
if quarto.format.isLatexOutput() then
layout = pandoc.List(tbl.layout):map(function(lst)
return pandoc.List(lst):map(function(cell)
return _quarto.ast.walk(cell, {
DecoratedCodeBlock = function(decorated)
decorated.hold = true
return decorated
end
})
end)
end)
end
local rows_div = pandoc.Div({})
for i, row in ipairs(tbl.layout) do
for i, row in ipairs(layout) do
local row_div = pandoc.Div(row)
if tbl.is_float_reftarget then
row_div = _quarto.ast.walk(row_div, {
Expand Down
37 changes: 37 additions & 0 deletions tests/docs/smoke-all/2025/03/21/issue-12344.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
format:
pdf:
keep-tex: true
---

::: {layout-ncol="2" .column-page-right}
``` {.markdown filename="01-import.qmd"}
---
title: Data Import and Cleaning
author: Soraya Drake
format:
html:
toc: true
code-fold: true
---

## Import

...
```

``` {.markdown filename="02-visualization.qmd"}
---
title: Exploratory Visualization
author: Soraya Drake
format:
html:
toc: true
code-fold: true
---

## Distributions

...
```
:::
Loading