I would like to be able to generate a series of tables in r-quarto. They are small tables, nothing fancy and generally will have the structure below in (1). A title that is a separate line of text and a table, this will repeat 20 or 30 times. To accomplish this I want to generate the code/formatting on the fly from what I read in from a table. What I have tried does not work (see 2 below) - I assume because the divs are wrapped in ":::{divs}" and therefore treated as text. How do I get r/quarto to recognize the divs output from code as something to render?
---
format:
docx:
reference-doc: MyQuartoStyles.docx
engine: knitr
editor: visual
---
```{r, echo=FALSE}
d<-"funtimes"
```
<!--This looks the way I want it-->
`r paste("1. ", d)`
::: {layout-ncol="2"}
Words
More Words
`r paste0(1:4,collapse=" \n")`
`r paste0(1:4,collapse=" \n")`
:::
<!--But, I want to be able to generate that in a code statement-->
`r paste("2. ", d, ":::{layout-ncol=2}", "Words", "More Words",":::", sep=" \n")`
\n\n) at the end of each section, not just one.\n\nyou are correct, my use of "` \n`" is what was causing the problem.