Revealjs slides with images that have larger than 100% width? #12128
-
DescriptionI would like to create a revealjs slide where the images are larger than the slide content margins. I've tried many things, but just can't figure it out. 😫 My current setup is: ---
title: "Test"
author: "me"
date: "2025-02-20"
format: revealjs
auto-stretch: false
---
## Image r-stretch
{.r-stretch fig-align="center"}
## Image 100% width
{width="100%" fig-align="center"}
## Image 150% width
{width="150%" fig-align="center"}
## Image 1000px width
{width="1000" fig-align="center"}
## Image 650px height
{height="650" fig-align="center"}
## Image 1000px width absolute
{.absolute left=-50 width="1000"} Here is the full reproducible example: Some unpleasant observations:
How can I force quarto to actually use the width that I provided (similar to height, only without distorting the image)? I'm using quarto 1.6.40 (latest) on macOS 14.6.1 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Reveal.js sets the size of the slide, what you have around is not the slide, so setting width to 100% won't change the size of the container. FYI, all your observations are HTML/CSS. That's independent of Quarto or Reveal.js. An alternative is to use background image. All this become obvious with other theme: https://emilhvitfeldt.github.io/quarto-revealjs-letterbox/#/title-slide |
Beta Was this translation helpful? Give feedback.
There are no margins in the slide content, everything around is only there to fill the gap which PDF (Beamer) or PowerPoint don't do.
The only margin is around the slide itself and it is set via
margin
YAML which is documented to modify the whole layout (https://quarto.org/docs/presentations/revealjs/advanced.html#presentation-size).As you can see the image occupies the full width of the slide with
.r-stretch
(this is a Reveal.js option, if you want to make advanced customisation, you need to read the Reveal.js documentation) and95%
without viamax-width
.You can tweak that and get your image overflow on the right.
Screen.Recording.2025-02-21.at.11.10.55.mov
Now, with absolute …