Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Code location in column layout in Quarto revealjs

I am trying to use the output-location: column option in a Quarto reveal.js presentation.

One problem arises when there are multiple outputs from the same chunk, in which case only the first part of the code is shown on the left side, and the other part continues below the first output.

Is there a way to put all code on the right side, and all output on the left?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Reproducible example:

---
format: revealjs
---

## A title

```{r}
#| output-location: column
#| echo: true
1:10

10:1 #This should be on the left side
```

I would like all code to be on the left side, and all output on the right.

enter image description here

>Solution :

You can add #| results: hold to your code block options to hold all text output to the end of the chunk, e.g.:

---
format: revealjs
---

## A title

```{r}
#| output-location: column
#| results: hold
#| echo: true
1:10

10:1 #This should be on the left side
```

This gives:

slides

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading