Rmd 笔记本中节号后的尾随句点

Trailing period after section number in Rmd notebook

我有一个如下所示的 R 笔记本:

---
title: "R Notebook"
output: 
  html_notebook:
    number_sections: true
    toc: true
---
# First section   
## Subsection
Some text

# Second section

当渲染到 RStudio 中的预览笔记本时,它会生成编号的部分标题,如 1 First section1.1 Subsection 等。如果我希望它在数字末尾添加一个点,即生成1. First section1.1. Subsection等?

您可以使用 CSS 来设置这些数字的样式。

例如,这些笔记本在 header 数字后有你想要的点:

---
title: "R Notebook"
output: 
  html_notebook:
    number_sections: true
    toc: true
---

```{css, echo=FALSE}
.header-section-number::after {
  content: ".";
}
```

# First section   
## Subsection
Some text

# Second section