34

I've been working in RMarkdown to make some slide sets, and have discovered odd behavior with respect to nested lists and mixing of list types. The following short presentation only works for slide 2. Nested lists are no longer nested and mixing incremental ordered and unordered lists fails entirely. I've tried this with a few different presentation formats, and it actually fails differently for different output types, which was surprising.

Thoughts?

---
title: "Attempt"
output: revealjs::revealjs_presentation
---

## Nested Incremental Lists

> * This
>   + kinda works (but is not nested)


##  Incremental Ordered Lists
> 1. This
> 2. works

## Broken - Nested mixed lists

> 1. This
>   + Does not work
3
  • May be something with you system, works for me. I used spaces for nesting. What did you use? tab, spaces
    – Ananta
    Commented Apr 26, 2016 at 13:56
  • Weird - I've tried both.
    – jebyrnes
    Commented Apr 26, 2016 at 14:01
  • Realise I'm digging up something here, but I can't get any of the solutions below to work - they don't seem to address the incremental aspect?
    – TMrtSmith
    Commented Mar 20, 2018 at 10:56

4 Answers 4

38

Try inserting four leading spaces. From the documentation (emphasis mine):

The four-space rule

A list item may contain multiple paragraphs and other block-level content. However, subsequent paragraphs must be preceded by a blank line and indented four spaces or a tab. The list will look better if the first paragraph is aligned with the rest:

The inconsistency to do with number of tabs may be due to how many spaces are inserted by default by Rstudio.

2
  • 1
    It seems the default size of <tab> in RStudio is 2 instead of 4. The above answer provides the concept behind the issue. Mine just seems to solve the issue ( a fluke probably) Commented Dec 19, 2017 at 15:27
  • In my case what made it work was to add latex's \newline at the end of each bullet point text when the second level starts Commented Jun 21 at 7:20
15

Worked when I gave 2 tabs, so:

1. This
<tab><tab>+ Should work
1
  • 1
    Although the inconsistent behaviour still troubles me.
    – jebyrnes
    Commented Apr 26, 2016 at 14:24
11

I was having the same problem and found a solution that worked. When making nested lists without incremental reveal, you need to add four spaces for sub-bullets. When making lists with incremental reveal, you need to add one space after >. So, when making sub-bullets with incremental reveal, you need five spaces between > and - (one for the incremental syntax, and four for the nested list syntax).

So, a regular list with incremental reveal would look like this:

><space>- Point 1
><space>- Point 2

If you want to add sub-bullets, this will not work:

><space>- Point 1
><space><space><space><space>- Sub-bullet
><space>- Point 2

But this will work:

><space>- Point 1
><space><space><space><space><space>- Sub-bullet
><space>- Point 2

Hope this is helpful/readable!

1
  • 1
    I think this answer should be documented
    – Omar113
    Commented Jan 8, 2020 at 7:19
2

As @Alex mentioned you have to give it 4 spaces. If you don't want to worry about this in the future you can set the tab preset to be 4 spaces. the solution will be

*something <space><space><space><space>+ Other thing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.