Pander list indentation different between Quarto and Rmarkdown

82 Views Asked by At

This R code:

pander::pander(list("1", "2", 3, c(1, 2)))

renders a list that looks like this in an Rmarkdown file:

list rendered in rmarkdown

and a list that looks like this in a Quarto file:

list rendered in quarto

How can I prevent the second indentation level in the quarto file?

1

There are 1 best solutions below

2
Julian On

Here is way using cat and results=asis:

---
format: html
---

```{r results='asis'}
cat(pander::pander(list("1", "2", 3, c(1, 2))))
```

enter image description here

My guess: pander::pander(list("1", "2", 3, c(1, 2))) results in this markdown code:

  * 1
  * 2
  * _3_
  * _1_ and _2_

which when you type this result into a quarto document works like you want. I assume that the cat and asis forces quarto to render it "correctly". I agree with Ben that it looks like a bug in quarto.