If I have a R code block,
```{r}
#| collapse: TRUE
1+1
mean(c(1,2,3))
summary(mtcars)
```
then the output and code are integrated in the same block. Moreover, the output is placed "in between" each new command:
Alternatively, if I write:
---
code-annotations: hover
---
```{r}
1+1 #<1>
mean(c(1,2,3)) #<2>
summary(mtcars) #<3>
```
1. This is a basic sum
2. Create vector and calculate mean
3. Summary statistics
then I have syntax annotation (on a quarto generated webpage). This feature is explained here.
However, things no longer work as expected when I want to combine the two features:
---
code-annotations: hover
---
```{r}
#| collapse: TRUE
1+1 #<1>
mean(c(1,2,3)) #<2>
summary(mtcars) #<3>
```
1. This is a basic sum
2. Create vector and calculate mean
3. Summary statistics
The output no longer is "in between" but everything is shown at the end. Since I have longer blocks of code, I want to avoid this, and show intermediate output along the way.