Adding custom CSS tags to an RMarkdown html document

前端 未结 3 1763
小蘑菇
小蘑菇 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

    Here are some additional ways of achieving custom css in RMarkdown

    • Add css between tags in the regular body of the RMarkdown (i.e. not in R code area), like so:
    
    
    # This heading will be padded {.pad}
    
    • Another option is to declare css: "style.css" in yaml and store styles in a separate file (style sheet) in the same directory
    • Or css can be generated and applied via R code (excellent example here)

提交回复
热议问题