2016-04-21 183 views
5

我试图找出如何包括使用reveal.js滑动,同时在RMarkdown写一拉http://rmarkdown.rstudio.com/revealjs_presentation_format.html添加标题幻灯片图像RMarkdown与reveal.js幻灯片

测试甲板我标题幻灯片中心的背景图片有是与style.css

.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%; 
    } 

注意如下

--- 
title: "Attempt" 
css: style.css 
output: revealjs::revealjs_presentation 
--- 

## Will this work 

- Did the title slide have an image? 

.title是唯一的东西会在标题幻灯片上显示任何图像。我根据我在SO和其他地方看过的内容尝试了其他几种组合。

.section .reveal .state-background基于Rstudio 0.98.1028 add background image only to title slide

.title-slide基于Adding an image to title slide using slidify

这些都不工作。我错过了什么吗?也许有一个我遗漏的魔术YAML选项?

回答

4

好的,这里是简单的答案。基本上,制作一个空白标题,然后在您的标题幻灯片上有一个图像作为数据背景。你也可以在标题幻灯片上做任何你想做的事情。我使用div来在幻灯片的中间放置一个不错的大标题。

--- 
title: 
output: revealjs::revealjs_presentation 
--- 

## {data-background="http://img1.wikia.nocookie.net/__cb20100706023807/familyguy/images/c/c7/Tauntaun.png"}