问题
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