我有一个如下所示的 R 笔记本:
---
title: "R Notebook"
output:
html_notebook:
number_sections: true
toc: true
---
# First section
## Subsection
Some text
# Second section
在 RStudio 中呈现给预览笔记本时,它会生成带编号的部分标题,例如 1 First section
、1.1 Subsection
等。如果我想让它在数字的结尾,即产生 1。第一部分
,1.1。小节
等?
最佳答案
您可以使用 CSS 来设置这些数字的样式。
例如,这些笔记本在您想要的标题编号之后有点:
---
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
关于r - Rmd 笔记本中节号后的尾随句点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56606970/