2016-04-21 192 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"}