Home > Software engineering >  Is there a way to nest unordered items in an ordered list in Rmarkdown?
Is there a way to nest unordered items in an ordered list in Rmarkdown?

Time:11-18

Am trying to nested unordered list within ordered list but seemingly it does not appear to work as desired. The nested list realigns with the top level list-which is undesired? Any leads?

---
title: "Nested list"
date: "18/11/2021"
output: word_document
---


i. Item 1
ii. Item 2
iii. Item 3
  - Sub item 1
  - Sub item 2

CodePudding user response:

Yes, this this is possible and there are several ways. One approach is to use only "i" instead of "iii" as numbering is done automatically. And then use 4 spaces for indentation. Here an example, where the "lorem ipsum" is a dummy text to demonstrate line breaks and indentation of the result.

---
title: "Nested list"
date: "18/11/2021"
output:
  word_document: default
---


i. Item 1: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
i. Item 2: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
i. Item 3: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
    - Sub item 1
    - Sub item 2: At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. 
    - Sub item 3

Nested list

  • Related