Adding a slide slide to RMarkdown slides using show.js

I'm trying to figure out how to include centered background images on slides using open.js slides while recording in RMarkdown a la http://rmarkdown.rstudio.com/revealjs_presentation_format.html

I have a test deck

--- title: "Attempt" css: style.css output: revealjs::revealjs_presentation --- ## Will this work - Did the title slide have an image? 

with style.css like

 .title { background-image: url(http://img1.wikia.nocookie.net/__cb20100706023807/familyguy/images/c/c7/Tauntaun.png); background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-size: 100% 100%; } 

Note. .title is the only thing that generally shows any images on the title slide. I tried several other combinations based on what I saw in SO and other places.

.section .reveal .state-background based on Rstudio 0.98.1028 add background image only to slide slide

.title-slide based Adding an image to a slide slide using slidify

None of these works. Am I missing something? Perhaps there is a magical version of YAML that I forgot?

+5
source share
1 answer

Ok, here is a simple answer. Essentially, create an empty caption, and then get the image as the data background on the caption slide. You can do whatever you want on this slide. I use divs to put a nice big title in the middle of the slide.

 --- title: output: revealjs::revealjs_presentation --- ## {data-background="http://img1.wikia.nocookie.net/__cb20100706023807/familyguy/images/c/c7/Tauntaun.png"} 
+4
source

Source: https://habr.com/ru/post/1247649/


All Articles