将RMarkdown编织为HTML时如何设置主题? [英] How to set a theme when knitting RMarkdown to HTML?

查看:293
本文介绍了将RMarkdown编织为HTML时如何设置主题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当将RMarkdown转换为HTML时,我还无法弄清楚如何设置编织主题. 我尝试了诸如

I have not been able to figure out how to set a knitr theme when converting RMarkdown to HTML. I have tried code such as

> opts_knit$set(out.format = "html")
> opts_chunk$set(highlight = TRUE)
> knit_theme$set("olive")

那不影响html输出.在编织Rmd文件以及第一个块内部之前,我已经尝试过此代码.

That does not affect the html output. I have tried this code before knitting the Rmd file as well as inside the first chunk.

推荐答案

将与R文件同名但扩展名为css的css文件放入目录.

Put a css file with the same name as your R file, but extension css, into the directory.

或参见 http://www.rstudio.com/ide/docs/authoring/markdown_custom_rendering

这篇关于将RMarkdown编织为HTML时如何设置主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆