Adding custom CSS tags to an RMarkdown html document

前端 未结 3 1768
小蘑菇
小蘑菇 2020-12-14 19:03

I have an RMarkdown document outputting to HTML of the same form as the below example. What do I add where to apply unique CSS ids or classes to each plot output?

         


        
3条回答
  •  情深已故
    2020-12-14 19:36

    You can tell knitr (which is used under the hood) with results="asis" to embed a chunk's output directly into the html. Within the chunk you can use cat to simply write a style tag including your css definitions:

    ```{r results="asis"}
    cat("
    
    ")
    ```
    

    See http://yihui.name/knitr/options/#chunk_options for details.

提交回复
热议问题