问题描述
我已经安装了以下软件:
I have the following installed:
- RStudio预览版,版本0.98.864(2014年5月24日)
- 通过devtools :: install_github(c("yihui/knitr","rstudio/shiny"))开发出Knitr和Shiny的版本
我想使用自定义CSS创建一个Shiny Presentation(RStudio菜单项:File> New File> RMarkdow> Shiny> Shiny Presentation),但是不确定如何创建.
I would like to create a Shiny Presentation (RStudio menu items: File>New File>RMarkdow>Shiny>Shiny Presentation) with custom CSS but am unsure how to do so.
我的自定义CSS(当前仅更改标题2的颜色)
My custom CSS (which currently only changes the colour of header 2)
h2 {
font-size:1.8em;
color: red;
}
---
title: "Habits"
author: John Doe
date: March 22, 2005
output:
ioslides_presentation:
css: temp.css
---
## Getting up
- Turn off alarm
- Get out of bed
但是,当我通过在序言中包含runtime: Shiny
将其转换为产生Shiny输出时,自定义格式不再起作用.
However, when I convert this to produce Shiny output by including runtime: Shiny
in the preamble, the custom formatting no longer works.
---
title: "Habits"
author: John Doe
date: March 22, 2005
runtime: shiny
output:
ioslides_presentation:
css: temp.css
---
## Getting up
- Turn off alarm
- Get out of bed
## Slide with Interactive Plot
```{r, echo=FALSE}
inputPanel(
selectInput("n_breaks", label = "Number of bins:",
choices = c(10, 20, 35, 50), selected = 20),
sliderInput("bw_adjust", label = "Bandwidth adjustment:",
min = 0.2, max = 2, value = 1, step = 0.2)
)
renderPlot({
hist(faithful$eruptions, probability = TRUE, breaks = as.numeric(input$n_breaks),
xlab = "Duration (minutes)", main = "Geyser eruption duration")
dens <- density(faithful$eruptions, adjust = input$bw_adjust)
lines(dens, col = "blue")
})
```
任何有关如何将自定义CSS与Shiny演示文稿一起使用的提示,将不胜感激.
Any tips on how to use a custom CSS with a Shiny presentation would be greatly appreciated.
修改与此问题类似,我无法通过在开头添加以下内容来添加自己的徽标(显然,在我自己的系统上将png更改为png):
EditSimilar to this problem, I have not been able to include my own logo by including the following in the front matter (obviously changing the png to one on my own system):
output:
ioslides_presentation:
logo: logo.png
我的订购清单也没有显示数字谢谢.
nor do my ordered lists show a numberThanks.
推荐答案
问题为自定义css支持开放的服务已于2014年6月24日关闭.
The issue opened for the custom css support was closed Jun 24, 2014.
使用原始问题文本进行测试确实确实显示了css中标明的h2
标题,还进行了添加logo: Rlogo-1.png
的测试,并且确实使用了徽标.
Testing with the original question text does indeed show the h2
headings colored as stated in the css, also tested adding logo: Rlogo-1.png
and indeed the logo is used.
这篇关于闪亮的演示文稿(幻灯片):自定义CSS和徽标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!