简体   繁体   English

闪亮的演示文稿(幻灯片):自定义CSS和徽标Windows 7/8

[英]Shiny Presentation (ioslides): Custom CSS and logo Windows 7/8

I don't yet have the rep to comment on an answer to an existing question so this a follow-up to the question: Shiny Presentation (ioslides): Custom CSS and logo 我还没有销售代表就现有问题的答案发表评论,因此这是该问题的后续内容: Shiny Presentation(ioslides):自定义CSS和徽标
This question was thought to be solved by fix 385bb28 on the Rstudio Github site. 该问题被认为可以通过Rstudio Github网站上的修复385bb28解决。 However, the issue has not resolved on either Windows 7 or Windows 8. 但是,此问题在Windows 7或Windows 8上均未解决。

I have several shiny ioslides presentations copied on my home and work machines. 我在家用和办公机器上复制了几个闪亮的ioslides演示文稿。 On each machine: 在每台机器上:

.Rmd files are saved with UTF-8 encoding .Rmd文件以UTF-8编码保存
R version - 3.1.2 R版本-3.1.2
Rstudio version - 0.98.1091 Rstudio版本-0.98.1091
rmarkdown version - 0.4.2 rmarkdown版本-0.4.2

When I run the following code on my home machine (Windows 8.1) the logo appears but the css is not applied. 当我在家用计算机(Windows 8.1)上运行以下代码时,将显示徽标,但未应用css。 Removing Runtime: shiny causes both the logo and css to work as intended 删除Runtime: shiny会使徽标和CSS均按预期工作

---
title: "Habits"
author: John Doe
date: March 22, 2005
output:
  ioslides_presentation:
    css: temp.css
    logo: logo.png
runtime: shiny
---

## Getting up

- Turn off alarm
- Get out of bed

On my work machine (Windows 7 Enterprise) running the above code results in the following error: 在运行以上代码的我的工作计算机(Windows 7 Enterprise)上,导致以下错误:

Error: Invalid regular expression 'C:Users\\jfreels\\AppData\\Temp\\RtmpW0cpcs\\file1d7845d27c4c_files/logo.gif', reason 'Invalid back reference' 错误:无效的正则表达式'C:Users \\ jfreels \\ AppData \\ Temp \\ RtmpW0cpcs \\ file1d7845d27c4c_files / logo.gif',原因为“无效的反向引用”

This error appears to fall in line with a discussion on the Rstudio site: https://support.rstudio.com/hc/communities/public/questions/203671936-Invalid-Back-Reference-when-running-a-Shiny-app 该错误似乎与Rstudio网站上的讨论一致: https : //support.rstudio.com/hc/communities/public/questions/203671936-Invalid-Back-Reference-when-running-a-Shiny-app

If I remove just the logo callout in the YAML header, the presentation successfully compiles but custom css doesn't appear. 如果仅删除YAML标头中的徽标标注,则演示文稿可以成功编译,但不会显示自定义css。 Again, removing Runtime: shiny causes both the css and the logo to function properly. 同样,删除Runtime: shiny会使CSS和徽标均正常运行。

Finally, in Windows 7 Enterprise if I remove the logo callout in the YAML header but include a plot in one of the slides, ie 最后,在Windows 7 Enterprise中,如果我删除了YAML标头中的徽标标注,但在其中一张幻灯片中包含了一个图,即

---
title: "Plot"
author: John Doe
date: March 22, 2005
output: ioslides_presentation
runtime: shiny
---

## Plot
```{r fig.show='asis'}
plot(cars)
```

I get the same 'Invalid back reference' error as discussed above (except the location of the error is listed as chunk-1). 我收到与上面讨论的相同的“无效的反向引用”错误(除了错误的位置列为chunk-1)。 BUT, if I change the chunk argument to fig.show='hide' the error does not appear and the presentation compiles successfully. 但是,如果我将块参数更改为fig.show='hide' ,则不会出现错误,并且演示文稿可以成功编译。

Thanks in advance for your help is solving this issue. 在此先感谢您的帮助,以解决此问题。

This problem can be fixed by installing version 0.5.2 of the rmarkdown package. 可以通过安装rmarkdown软件包的0.5.2 来解决此问题。 Currently this is the development version and can be installed from GitHub using: 当前,这是开发版本,可以使用以下命令从GitHub安装:

install.packages("devtools")
library(devtools)
devtools::install_github("rstudio/rmarkdown") 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM