rlistr-markdownquarto

quarto bullet list under a list item


I have the following qmd file of bullet lists:

---
title: "lists"
format: html
editor: visual
---


# hello

this is my first sentance of lists:

-   my first list:


```{r bulletlist1, echo = FALSE, eval = TRUE, results = 'asis'}
cat(paste("*", levels(iris$Species)), sep = "\n")
```



-   this is next

    other lists:

```{r bulletlist2, echo = FALSE, eval = TRUE, results = 'asis'}
cat(paste("*", levels(iris$Species)), sep = "\n")
```

    $~$

    and the other lists:
    

```{r bulletlist3, echo = FALSE, eval = TRUE, results = 'asis'}
cat(paste("*", levels(iris$Species)), sep = "\n")
```

which returns:

enter image description here

but i want:

enter image description here

Previously in rmd, I have indented the chunks like this (although when I have updated packages it doesn't seem to work anymore even in rmd):

---
title: lists
---

# hello

this is my first sentance of lists:

-   my first list:


    ```{r bulletlist1, echo = FALSE, eval = TRUE, results = 'asis'}
cat(paste("*", levels(iris$Species)), sep = "\n")
```



-   this is next

    other lists:

    ```{r bulletlist2, echo = FALSE, eval = TRUE, results = 'asis'}
cat(paste("*", levels(iris$Species)), sep = "\n")
```

    $~$

    and the other lists:
    

    ```{r bulletlist3, echo = FALSE, eval = TRUE, results = 'asis'}
cat(paste("*", levels(iris$Species)), sep = "\n")
```

Any suggestions?

thanks


Solution

  • Take "- " instead of "*" we are in a qmd list and not in rmd bullet points!

    Out

    out

    Code

    ---
    title: "Dynamic lists :)"
    format: html
    editor: visual
    ---
    
    -   my first list:
    
        ```{r bulletlist1, echo = FALSE, eval = TRUE, results = 'asis'}
        cat(paste("- ", levels(iris$Species)), sep = "\n")
        ```
    
    -   this is next
    
        other lists:
    
        ```{r bulletlist2, echo = FALSE, eval = TRUE, results = 'asis'}
        cat(paste("- ", levels(iris$Species)), sep = "\n")
        ```
    
        $~$
    
        and the other lists:
    
        ```{r bulletlist3, echo = FALSE, eval = TRUE, results = 'asis'}
        cat(paste("- ", levels(iris$Species)), sep = "\n")
        ```