Eri*_*ail 6 r dynamic slideshow r-markdown xaringan
在r-markdown中是一个将yamltitle:移出主yaml的选项,如R Markdown Cookbook 中所述。
但是,在xaringan幻灯片中,新幻灯片---似乎与新幻灯片的想法相冲突。
下面的代码有效,但是当将第 2 行移到title: "Presentation Ninja"主yaml之外并将其插入为title: "The name of the dog is r dog_name 时!",通过删除<!-- ... -->第 17-19 行中的所有代码,它无法按预期工作。我不再得到标题页。我想我需要解决---in xaringan 问题?
任何帮助,将不胜感激!
---
title: "Presentation Ninja"
subtitle: "?<br/>with xaringan"
author: "Yihui Xie"
output:
xaringan::moon_reader:
lib_dir: libs
---
# xaringan set the document title dynamically
```{r, code=xfun::read_utf8('script_with_many_dog_names.R')}
```
The name of the dog is `r dog_name`!
<!-- --- -->
<!-- title: "The name of the dog is `r dog_name`!" -->
<!-- --- -->
Some bullets
- Foo
- Bar
Run Code Online (Sandbox Code Playgroud)
您可以将逻辑直接添加到标题中,这对我来说似乎效果很好:
\n---\ntitle: "The number is `r round(100 * runif(1), 2)`"\nsubtitle: "\xe2\x9a\x94<br/>with xaringan"\nauthor: "Yihui Xie"\noutput:\n xaringan::moon_reader:\n lib_dir: libs\n---\nRun Code Online (Sandbox Code Playgroud)\n\n