You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 98ecd38
Browse filesBrowse the repository at this point in the historyBrowse files
Fix revealjs auto-stretch moving top figure captions below the image (#15387)
* Keep figure caption location when revealjs auto-stretches an image (#8938)
Auto-stretch moves a slide's only image to slide level and rebuilds its
figcaption as a p.caption next to it. That caption was always inserted
after the image, so fig-cap-location: top was lost on every slide where
auto-stretch applied; only auto-stretch: false kept the caption on top.
The caption now goes back on the side of the image it had in the figure.
This uses document order rather than the quarto-float-caption-top class
because a figure without a crossref label gets a figcaption with no
class.
Fixes#8938
* Size revealjs stretched-figure captions placed above the image (#8938)
The revealjs caption size rule only matched a p.caption that follows a
stretched image. Now that auto-stretch keeps a top caption before the
image, that caption fell back to the full slide text size. The rule now
also matches a caption followed by a stretched image, using :has().
A Playwright test checks the computed font size, since the HTML alone
cannot show whether the rule applies.
Copy file name to clipboardExpand all lines: news/changelog-1.12.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,7 @@ All changes included in 1.12:
57
57
### `revealjs`
58
58
59
59
- ([#7378](https://github.com/quarto-dev/quarto-cli/issues/7378)): Add `code-line-fragment-indices` to set the fragment index of each step of stepped `code-line-numbers` highlighting. (author: @mcanouil)
60
+
- ([#8938](https://github.com/quarto-dev/quarto-cli/issues/8938)): Fix figure captions placed below the image when `fig-cap-location: top` is set and the image is auto-stretched to fill the slide.
A figure alone on a slide is auto-stretched: the image moves out of its figure to the slide level and its caption is rebuilt as a `p.caption` next to it. That caption must stay above the image when `fig-cap-location: top` is set.
24
+
25
+
{#fig-top}
26
+
27
+
## Unlabelled {#unlabelled}
28
+
29
+

30
+
31
+
## Knitr {#knitr}
32
+
33
+
```{r}
34
+
#| label: fig-knitr
35
+
#| fig-cap: "Caption on top"
36
+
#| echo: true
37
+
plot(1:10)
38
+
```
39
+
40
+
## Bottom {#bottom}
41
+
42
+
{#fig-bottom cap-location="bottom"}
0 commit comments