在 RMarkdown 中自动编号部分 [英] Automatically number sections in RMarkdown

查看:52
本文介绍了在 RMarkdown 中自动编号部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 R markdown 中创建一个报告,其中包含已排序的部分

  1. 第 1 节标题

    1.1 小节 1

    1.2 小节 3

  2. 第 2 节标题

    2.1

    2.2 小节

     2.2.1 另一个小节

有没有办法让 R markdown 生成这样的有序列表?

解决方案

添加

I am trying to create a report in R markdown that has sections ordered

  1. Section 1 Header

    1.1 sub section 1

    1.2 sub section 3

  2. Section 2 Header

    2.1

    2.2 sub section

      2.2.1 another sub section
    

Is there a way get R markdown to generate an ordered list like this?

解决方案

Add the option number_sections: true to your YAML header:

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

# Main Section

## 2nd Level

### 3rd Level

And voilá, your sections are numbered:

这篇关于在 RMarkdown 中自动编号部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆