41

How do I make second level bullets in RMarkdown from Rstudio?

I tried

* Level1
  + leve2

and it didn't work. It's not exactly clear how to do it from the tutorial. This seems so simple to do in normal RMarkdown.

xiaodai
  • 14,889
  • 18
  • 76
  • 140
  • saying it didnt work and providing two lines of code is not helpful – rawr Oct 31 '14 at 03:40
  • 25
    [seems 4 spaces is the key](http://www.macdrifter.com/2012/04/writing-in-markdown-lists.html) (or **two** tabs for me in Rstudio) – user20650 Oct 31 '14 at 05:14
  • 6
    You have to make sure the full list is recognized as a bulleted list by inserting a blank line before the first bullet *and* you have to have 4 spaces before the '+' character for this to work. – paul-boardman May 26 '16 at 15:31

3 Answers3

21
---
title: "Untitled"
date: "Friday, October 31, 2014"
output: pdf_document
---


```{r}
summary(cars)
```


1. Item 1
2. Item 2
    a. Item 2a
    b. Item 2b

Look at the above one, maybe the spacing is the problem

Keniajin
  • 1,649
  • 2
  • 20
  • 43
  • 13
    With Rpres, it was sufficient to indent second-level list by two spaces, conveniently lining up with the text of the first-level items. But when the output is produced by Pandoc (e.g., for Beamer or ioslides documents), you have to indent by four spaces. – Davor Cubranic Apr 28 '15 at 18:17
  • This should be the accepted answer. Is also older than [this](https://stackoverflow.com/questions/36866916/incremental-nested-lists-in-rmarkdown) question, but is essentially the same, despite being about Rmarkdown. – DryLabRebel Jul 12 '19 at 01:08
14
  • Level 1
    • Level 2 (four spaces)

This works for me.

Vishanth
  • 1,320
  • 3
  • 14
  • 26
4

The OP asked about ioslides, so:

Although it isn't detailed in the ioslides guide, the comment by @user20650 is correct: When using ioslides, simply ensure you use four spaces or one tab for the second level, e.g.:

---
title: "Untitled"
output: ioslides_presentation
---

## Slide Header

- Level 1
    - Level 2

Note, you could also use basic html to kludge it:

---
title: "Untitled"
output: ioslides_presentation
---

## Slide Header

<ul>
<li>Level 1
    <ul>
    <li>Level 2</li>
</li>
</ul>

Subsequent levels simply require more spaces added before the bullet:

---
title: "Untitled"
output: ioslides_presentation
---

## Slide Header

- Level 1
    - Level 2
        - Level 3
wes
  • 75
  • 1
  • 6