How to set a theme when knitting RMarkdown to HTML?

北城以北 提交于 2021-02-19 03:50:06

问题


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")

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


回答1:


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

Or see http://www.rstudio.com/ide/docs/authoring/markdown_custom_rendering



来源:https://stackoverflow.com/questions/18288379/how-to-set-a-theme-when-knitting-rmarkdown-to-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!