Automatically number sections in RMarkdown

前端 未结 1 1495
無奈伤痛
無奈伤痛 2020-12-28 14:20

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

相关标签:
1条回答
  • 2020-12-28 14:40

    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:

    0 讨论(0)
提交回复
热议问题