如何在文档中定义自定义 CSS?

How to define custom CSS within the document?

根据 RStudio documentation of RPres,有一种方法可以在 .Rpres 文档中添加一些自定义 CSS 样式:

[I]f you prefer to include styles right within the presentation source file you can also place them at the top of the source above the title slide (any style tags included there will automatically be appended to the head element).

我是不是误会了什么?以下应根据该工作:

.reveal section del {
  color: red;
}

test
========================================================

test
========================================================

~~should be red~~

但这会产生:

很明显,它没有被解析为 CSS。我错过了什么吗?

如果我只是将该部分单独保存到一个同名的 .css 文件中(正如在同一文档中提到的那样),它会按预期工作。我只是不明白创建一个单独的文件定义一个自定义样式的意义。

样式需要包裹在<style></style>

<style>
.reveal section del{
  color: red;
}
</style>

csstest
========================================================
author: 
date: 
autosize: true


test
========================================================

~~should be red~~

我发现 this presentation 是一个有用的资源