inf_mr不随xaringan幻灯片刷新

时间:2019-03-02 01:29:13

标签: r markdown xaringan

在演示开始时,我用---保存xaringan幻灯片时,必须先将其删除,然后xaringan::inf_mr()将刷新查看器面板并更新更改。以下示例应有助于解决这种情况:

(1)创建.md文件...

---
title: "Presentation Ninja"
date: "2016/12/12 (updated: `r Sys.Date()`)"
output:
  xaringan::moon_reader:
    lib_dir: libs
    nature:
     highlightStyle: github
     highlightLines: true
     countIncrementalSlides: false
---
layout: true
background-image: url(https://github.com/yihui/xaringan/releases/download/v0.0.2/karl-moustache.jpg)
background-position: 91% 94%
background-size: 185px

<!-- Must have this break below -->
---

```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
```

# Test slide
Testing

---

# Test slide 2
Testing

---

# Test slide 3
Testing

(2)现在,我使用xaringan::inf_mr()运行Rmd文件...执行此操作时,查看器将不会刷新,除非我现在在不保存的情况下注释/删除了---

---
title: "Presentation Ninja"
date: "2016/12/12 (updated: `r Sys.Date()`)"
output:
  xaringan::moon_reader:
    lib_dir: libs
    nature:
     highlightStyle: github
     highlightLines: true
     countIncrementalSlides: false
---
layout: true
background-image: url(https://github.com/yihui/xaringan/releases/download/v0.0.2/karl-moustache.jpg)
background-position: 91% 94%
background-size: 185px
<!-- Commented Out Now -->
<!-- --- -->

```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
```

# Test slide
Testing

---

# Test slide 2
Testing

---

# Test slide 3
Testing

现在,查看器将刷新。但是,每次我必须保存Rmd文件时,如果要查看器正常工作,则必须取消对此---的注释/重新注释。我肯定缺少一些基本的东西,但是我不相信其他人已经报告了这个问题。

以下是有关我的系统的其他一些详细信息:

R.Version()
$`platform`
[1] "x86_64-w64-mingw32"

$arch
[1] "x86_64"

$os
[1] "mingw32"

$system
[1] "x86_64, mingw32"

$language
[1] "R"

$version.string
[1] "R version 3.5.1 (2018-07-02)"

$nickname
[1] "Feather Spray"

-

rstudioapi::versionInfo()
$`mode`
[1] "desktop"

$version
[1] ‘1.2.1237’

我的xaringan版本是 0.8.15

如果需要进一步说明,请告诉我。

谢谢!

编辑

我在.Rmd文档中添加了以下代码(基于this wiki),这应该可以更好地说明所面临的问题:

layout: true
background-image: url(https://github.com/yihui/xaringan/releases/download/v0.0.2/karl-moustache.jpg)
background-position: 91% 94%
background-size: 185px

1 个答案:

答案 0 :(得分:1)

xaringan::inf_mr()的{​​{3}}使其无法正确计算幻灯片数量(未考虑layout: true)。我有a bug,您可以通过以下方式安装开发版本:

remotes::install_github('yihui/xaringan')