自动为RMarkdown中的部分编号

时间:2016-10-19 00:14:16

标签: r-markdown

我正在尝试在R markdown中创建一个包含部分

的报告
  1. 第1节标题

    1.1第1节

    1.2 sub section 3

  2. 第2节标题

    2.1

    2.2子节

      2.2.1 another sub section
    
  3. 有没有办法让R markdown生成这样的有序列表?

1 个答案:

答案 0 :(得分:44)

将选项number_sections: true添加到您的YAML标题中:

---
title: "My Report"
output: 
  html_document:
    number_sections: true
---

# Main Section

## 2nd Level

### 3rd Level

瞧,你的部分已编号:

enter image description here