5

I want to have an image to fill the whole slide. I have tried to use a div with absolute positioning, however, that will position the image partly outside of the slide.

I think I could make that work, if I hard code the resolution in, however, I would like to make it work on another machine as well. (and preferably even with the wide screen switching)

An example to reproduce/test:

---
title: "some title"
author: Me
company: Me
date: 21-02-2017
output:
    ioslides_presentation

---

##

![test image](https://i.ytimg.com/vi/yaqe1qesQ8c/maxresdefault.jpg)

edit: I am aware of: Rpresentation in Rstudio - Make image fill out the whole screen However, there they switched to slidy_presentation and I already have custom css for ioslides. If possible I would like to stay with ioslides. And it should be possible, right? :)

Community
  • 1
  • 1
wligtenberg
  • 7,695
  • 3
  • 22
  • 28
  • Have you read this post? http://stackoverflow.com/questions/23619319/rpresentation-in-rstudio-make-image-fill-out-the-whole-screen – J_F Feb 21 '17 at 08:48
  • Yes, sorry forgot to mention that, but in that post he switched away from ioslides. I would prefer not to do that, since I already have custom css for ioslides. – wligtenberg Feb 21 '17 at 08:53

1 Answers1

5

I got an idea when I was looking for getting my text output even smaller.

I found this: Markdown: Change default font size of code chunks in ioslides

Now I am using the following custom css:

.fullslide img {
  margin-top: -85px;
  margin-left: -60px;
}

Then in in the rmarkdown file I can do:

## {.fullslide}

![](image.jpg)

If you now want to make sure that you get the full image, make sure the image has the following dimensions:

  • widescreen: 1100 x 700
  • normal: 900 x 700

I just make sure I edit them using GIMP or something. I have not yet figured out how I can suppress the page numbering, but apparently you cannot suppress page numbers on a per slide basis. :(

Community
  • 1
  • 1
wligtenberg
  • 7,695
  • 3
  • 22
  • 28