I have this Rmarkdown file:
---
title: "Indent heading under list"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## This is a heading
1. I have some numbered list items under this heading
2. And I want to have sub-heading under this numbered listed
3. Under this new sub-heading, I want to have tabs under it
### Sub-heading I want {.tabset .tabset-fade .tabset-pills}
#### Apple
- This is an apple
#### Orange
- This is an orange
###
4. I want the above sub-heading to have indentation so that it is indented under item number 3 above
Which is currently like this:
As explained in the Rmarkdown itself, I want to have indentation of the sub-heading under the numbered list, so that it will look like this:
Most resources I found online recommend manually indenting the heading(s) with four spaces under the numbered list, but that doesn’t work (see attached screenshot).
2
Answers
If you want something to be part of the list item, in markdown you need to indent it beyond the list marker. Thus indent it either three or four spaces:
If you add an indented hyphen before the
###
then this creates an indented sub-header. But then there’s a bullet, I don’t know how to get rid of this one.