gpt4 book ai didi

r - xaringan 动态设置文档标题

转载 作者:行者123 更新时间:2023-12-03 14:12:48 25 4
gpt4 key购买 nike

是移动 title: 的选项出主 , as described in the R Markdown Cookbook .
但是,在 中滑套新品---似乎与新幻灯片的想法冲突。
下面的代码有效,但是当移动第 2 行时,title: "Presentation Ninja"外主 ,并将其插入为 title: "The name of the dog is r dog_name !" , 通过删除我所有的 <!-- ... -->第 17-19 行中的代码,它 不起作用 正如预期的那样。我不再得到标题页。我想我需要解决 --- ?
任何帮助,将不胜感激!

---
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

最佳答案

您可以将逻辑直接添加到标题中,这对我来说似乎很好用:

---
title: "The number is `r round(100 * runif(1), 2)`"
subtitle: "⚔<br/>with xaringan"
author: "Yihui Xie"
output:
xaringan::moon_reader:
lib_dir: libs
---
example

关于r - xaringan 动态设置文档标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66312392/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com