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
4 changes: 4 additions & 0 deletions news/changelog-1.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ All changes included in 1.8:
- ([#12554](https://github.com/quarto-dev/quarto-cli/pull/12554)): CSS properties `font-weight` and `font-style` are translated to Typst `text` properties.
- ([#12739](https://github.com/quarto-dev/quarto-cli/pull/12739)): Remove unused variable `heading-background-color` and `heading-decoration` from Typst's templates. They are leftover from previous change, and not part of Brand.yml schema for typography of headings.

### `beamer`

- ([#12775](https://github.com/quarto-dev/quarto-cli/issues/12775)): Convert Quarto-native layouts (divs with `layout` syntax) to Beamer columns, equivalent to using the Pandoc-native syntax of div with `columns` and `column` classes.

## Projects

### `website`
Expand Down
3 changes: 0 additions & 3 deletions src/resources/filters/common/layout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ function layout_align_attribute(el_with_attr, default)
return validatedAlign(el_with_attr.attributes[kLayoutAlign], default)
end

-- now unused. Remove?
-- luacov: disable
function layout_valign_attribute(el_with_attr, default)
return validatedVAlign(el_with_attr.attributes[kLayoutVAlign] or default)
end
-- luacov: enable

function attr_has_layout_attributes(attr)
local attribs = tkeys(attr.attributes)
Expand Down
4 changes: 2 additions & 2 deletions src/resources/filters/common/validate.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
-- validate.lua
-- Copyright (C) 2020-2022 Posit Software, PBC

kAlignments = pandoc.List({ "center", "left", "right" })
kVAlignments = pandoc.List({"top", "center", "bottom"})

function validatedAlign(align, default)
local kAlignments = pandoc.List({ "center", "left", "right" })
return validateInList(align, kAlignments, "alignment", default)
end

function validatedVAlign(vAlign)
local kVAlignments = pandoc.List({"top", "top-baseline", "center", "bottom"})
return validateInList(vAlign, kVAlignments, "vertical alignment", "top")
end

Expand Down
36 changes: 34 additions & 2 deletions src/resources/filters/layout/latex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kSideCaptionEnv = 'sidecaption'

_quarto.ast.add_renderer("PanelLayout", function(_)
return _quarto.format.isLatexOutput()
end, function(layout)
end, function (layout)
local rendered_panel = latexPanel(layout)
local preamble = layout.preamble
if preamble == nil then
Expand All @@ -18,9 +18,41 @@ end, function(layout)
return result
end)

_quarto.ast.add_renderer("PanelLayout", function(_)
return _quarto.format.isBeamerOutput()
end, function(panel)
local result = pandoc.Blocks({})
if panel.preamble then
panel_insert_preamble(result, panel.preamble)
end

for i, row in ipairs(panel.layout) do
local beamer_cols = pandoc.Div({}, pandoc.Attr("", { "columns" }))
for j, cell in ipairs(row) do
local attrs = {}
local align = nil
-- NB: column "align" in beamer is "valign" in our layouts
if cell.attributes["valign"] then
align = cell.attributes["valign"]
end
if cell.attributes["width"] then
attrs.width = cell.attributes["width"]
end
if align then
attrs.align = align
end
local beamer_col = pandoc.Div({}, pandoc.Attr(cell.identifier, { "column" }, attrs))
beamer_col.content:extend(cell.content)
beamer_cols.content:insert(beamer_col)
end
result:insert(beamer_cols)
end

return result
end)

-- function latexPanel(divEl, layout, caption)
function latexPanel(layout)

-- begin container
local env, pos = latexPanelEnv(layout)
local panel_node, panel = quarto.LatexEnvironment({
Expand Down
17 changes: 17 additions & 0 deletions tests/docs/smoke-all/2025/05/19/issue-12775.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: "title"
date: last-modified
format: beamer
---

## slide

::::::{layout="[48, 48]"}
:::{#first-column valign="bottom"}
hallo
:::
:::{#second-column valign="top-baseline"}
### a block title
du
:::
::::::
Loading