将 .css 文件与 markdown .doc 链接

Linking a .css file with a markdown .doc

我正在尝试在我的 Rmarkdown 文件中使用一些 .css。因此我创建了一个包含以下文本的记事本文件:

#nextsteps {
color: blue;
}  

.emphasized {
font-size: 1.2em;
}

并保存为styles.css

在此之后,我使用以下代码在同一文件夹中创建了一个 .Rmd 文件:

---
title: "test2"
output: html_document
 theme: null
 highlight: null
 css: styles.css
 ---

 ## Next Steps {#nextsteps}

当我尝试编织它时,却出现以下错误:

 Error in yaml::yaml.load(enc2utf8(string), ...) : 
 Scanner error: mapping values are not allowed in this context at line 3, column 9
 Calls: <Anonymous> ... yaml_load_utf8 -> mark_utf8 -> <Anonymous> -> .Call
 Execution halted

想知道这里出了什么问题吗?

使用 yaml 格式化很重要。

---
title: "test2"
output: 
  html_document:
    theme: null
    highlight: null
    css: styles.css
---