Automatic Section Number in RMarkdown

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

  • Section 1 Title

    1.1 subsection 1

    1.2 section 3

  • Section 2 Title

    2.1

    2.2 section

    2.2.1 another sub section 

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

+16
source share
2 answers

Add option option number_sections: true to the YAML header:

 --- title: "My Report" output: html_document: number_sections: true --- # Main Section ## 2nd Level ### 3rd Level 

And voila, your sections are numbered:

The above text in an image with numbered sections

+54
source

thanks, but in my MAC, number_sections: true do not affect rmarkdown :: render in html files, what is the problem?

0
source

Source: https://habr.com/ru/post/1258436/


All Articles