Repository navigation
Description
Bug description
cap-location: margin (and fig-cap-location / tbl-cap-location) needs a margin column, and beamer, revealjs and dashboards don't have one.
In beamer the document fails to compile. In revealjs and dashboards the option is silently ignored: the caption gets the margin classes but stays in flow.
top and bottom work in all three formats, for figures and tables.
Steps to reproduce
doc.qmd
---
title: Margin caption
format: beamer
cap-location: margin
---
## Slide
::: {#fig-a}
Figure content.
Figure caption
:::quarto render doc.qmd
quarto render doc.qmd --to revealjsActual behavior
beamer:
ERROR:
compilation failed- error
LaTeX cmd Error: Environment 'figure*' undefined.
The margin caption is emitted as \sidecaption, which loads the sidenotes LaTeX package, and that package needs a figure* environment that beamer doesn't define. Same cause as #10733 for .aside.
quarto-cli/src/resources/filters/layout/latex.lua
Lines 143 to 152 in 4856b1f
| function latexCaptionEnv(el) | |
| if el.attributes['quarto-caption-env'] then | |
| return el.attributes['quarto-caption-env'] | |
| end | |
| if el.classes:includes(kSideCaptionClass) then | |
| return kSideCaptionEnv | |
| else | |
| return 'caption' | |
| end | |
| end |
revealjs: the figure gets figcaption.quarto-float-caption-margin, but there is no margin column on a slide, so the caption stays below the figure at full slide width.
dashboard: the caption wrapper gets the margin class and a grid column, but the card lays it out with flex, so the caption stays centred in the card.
The same happens with a cap-location="margin" attribute on a figure or table div, and with the fig-cap-location: margin / tbl-cap-location: margin chunk options in knitr.
Expected behavior
The document renders, and margin falls back to bottom in formats that have no margin column, as #10124 did for Typst before it supported margins. A warning would make the fallback visible.
Completion in front matter could also offer margin only for formats that support it, while keeping top and bottom for every format. Since #15370 (not yet released), the three options are not offered at all in beamer, revealjs and dashboards.
Your environment
- Quarto 1.11.9 for the beamer error and revealjs output above, the 1.12 dev build for the dashboard and the attribute and chunk option cases
- Windows 11
Activity
Fall back to bottom captions for margin in beamer, slides, dashboards (…