How can I control the DOM programmatically from Quarto? #9780
-
DescriptionI wrote the following code to create a Revealjs presentation programmatically from Quarto using R but, even though it is very similar to other people's code I have seen online, it does not work as expected. The two images should be placed side-by-side as specified by the class, instead they are in one column, one above the other: ---
title: "A study"
author: "Author"
format:
revealjs:
navigation-mode: grid
slide-number: h.v
slide-level: 3
execute:
echo: false
---
```{r}
#| echo: false
#| output: asis
patients <- 1:4
for (patient_num in patients) {
cat(paste("\n## Patient", patient_num))
cat('\n::: {layout-ncol=2}\n')
cat(paste0("\n"))
cat(paste0("\n"))
cat(':::\n')
}
``` Can anyone tell me what I am doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Can you format your code part correctly ? https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us Also, you should look at This will allow to know if this is something related to how Knitr produce the output or just something not working and not involving the R computation part. |
Beta Was this translation helpful? Give feedback.
@AlbertoFabbri93 I missed this but this is because you are not adding images on two paragraphs
This is only one paragraph in Markdown, so there is nothing to but in the right column.
You need to add each one in its own paragraph
So add a newline