最近在R-bloggers上看到一篇做幻灯片的文章,具体请戳这里,有一个关于做Revealjs Presentation,我觉得蛮有意思的,我把源代码放上来
---
title: "Revealjs Presentation Example"
author: "Paula LC"
date: "September 24, 2019"
output:
revealjs::revealjs_presentation:
theme: moon
highlight: pygments
---
## Basic slide with text and lists
Hello world!
- List item 1
- List item 2
+ List item 2.1
## Equations
This summation expression $\sum_{i=1}^n X_i$ appears inline.
<code class="katex-escape">$$f(y|N,p) = {{N}\choose{y}} \cdot p^y \cdot (1-p)^{N-y}$$</code>
## Tables
```{r cars, echo = TRUE, results='asis'}
mod <- lm(dist~speed, data=cars)
pander::pander(mod, type = 'html', title = 'Table with pander')
```
## Interactive plot
```{r, echo=FALSE, warning=FALSE}
library(leaflet)
m <- leaflet() %>%
addTiles() %>%
addMarkers(lat=40.3325364, lng=-3.7675058, popup="Coding Club UC3M")
m
```
## A background page {data-background-iframe='https://codingclubuc3m.rbind.io'}
theme参数可以选择"default", "dark", "simple", "sky", "beige", "serif", "solarized", "blood", "moon", "night", "black", "league", "white"
受到这个幻灯片的启发,我想对我的xaringan幻灯片做如下定制:
- 增加切换效果,包括但不限于Revealjs Presentation这种效果。
- 在yaml里增加一个theme参数,可以很方便地调整背景颜色。xaringan貌似是需要在CSS里面定义.inverse
- 增加一个进度条,当然用页码表示,比如“2/30”其实已经起到进度条的作用,我想说的是花样可以多一些。
- 像slidy_presentation一样加一个导航目录就更爽了。