问题描述
我刚刚开始使用RStudio中的一些新的knitr功能.
I've just started playing with some of the new knitr features in RStudio.
我尝试在R Markdown设置对话框中选择几个不同的主题,但是这些主题似乎对我生成的文档的样式没有任何明显的影响.是应该的,还是我想念的东西?无论选择哪种主题,一切似乎都以默认样式显示.
I've tried selecting several of the different themes in the R Markdown settings dialogue but these don't seem to have any noticeable impact on the style of my resulting document. Should it, or am I missing something? Everything just seems to come out in the default style no matter what theme I select.
---
output:
html_document:
number_sections: yes
theme: spacelab
toc: yes
pdf_document: default
word_document: default
---
安装详细信息:
- R版本3.1.1
- RStudio版本0.98.977
- 针织衫1.6
- rmarkdown 0.2.50
- htmltools 0.2.4
- Windows 7
推荐答案
我遇到了完全相同的问题,并且可以通过将主题参数放在任何其他参数之前来解决此问题.我不确定命令是否重要,但就我而言确实如此.例如,这可以正确更改我的html主题:
I had this exact same problem and I was able to solve it by placing the theme argument before any other arguments. I am unsure if the order matters, but in my case it did. For example, this correctly changes my html theme:
---
title: "A Title"
author: "An Author"
date: "last update: `r format(Sys.Date(), format = '%d %B %Y')`"
output:
html_document:
theme: flatly
highlight: haddock
toc: true
toc_float:
collapsed: false
smooth_scroll: true
---
在最后提供主题参数时无效:
While providing the theme argument towards the end did not work:
---
title: "A Title"
author: "An Author"
date: "last update: `r format(Sys.Date(), format = '%d %B %Y')`"
output:
html_document:
toc: true
toc_float:
collapsed: false
smooth_scroll: true
theme: flatly
highlight: haddock
---
我的语法突出显示参数也是如此.
This also was true for my syntax highlighting argument.
这篇关于RStudio针织主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!