如何在 rmarkdown 中编辑引导程序主题



我目前正在 rmarkdown 中使用 cosmo 主题。如果我想更改导航菜单的颜色,或者更具体地说,更改菜单突出显示的颜色,我应该编辑哪个文件?

如果你真的想改变cosmos CSS,你可以在这里找到它: [path to libraries]/rmarkdown/rmd/h/bootstrap-3.3.5/css/cosmo.min.css 但是,如果我只需要更改一件事,我通常只需将 CSS 放入 markdown 文档中,如以下示例所示。

您还可以附加自己的 CSS,如下所述:http://rmarkdown.rstudio.com/html_document_format.html#custom_css

---
title: "Untitled"
author: "Ian Wesley"
date: "May 25, 2017"
output: 
  html_document:
    theme: cosmo
---
<style>
  h2{
    font-size: 50px !important;
    color: crimson !important
  }
</style>
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
summary(cars)
```
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```

最新更新