quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.75k stars 306 forks source link

output-location: column does not work with tabsets #3301

Open albarran opened 1 year ago

albarran commented 1 year ago

Hi,

I am not sure if this is a bug or a feature, although but I have not been able to find it documented nor in other bugs reports.

I have Quarto document with output format revealjs. I include in my code chunks the options echo: true and output-location: column (the same happens with column-fragment).

It works as expected when in a regular slide. But if the code chunk in under panel tabset the output is not shown in an adjacent column, but below the code. Here is an example

---
title: "test"
format: revealjs
---

## Works as expected

Code in the left and `4` shown in an adjacent column.

```{r}
#| echo: true
#| output-location: column
2 + 2

Tabset

::: {.panel-tabset}

Tab 1

First tab

Tab 2

Here output 4 is shown below the code

#| echo: true
#| output-location: column
2 + 2

:::



Not sure if relevant in this case, but for completeness, I am using RStudio 2022.07.02 (build 576) with `knitr` engine under Linux (Lubuntu 22.10).

Thanks a lot in advance!
jjallaire commented 1 year ago

It's not entirely surprising that this occurs given the multiple transformations in play (tabs, column-based outputs). This is a bug but might be tricky to fix.

albarran commented 1 year ago

Thanks, @jjallaire!

A quick question that can become a bit off-topic (sorry, and so, please, feel free to ignore it). A workaround to the above issue is to manually create two columns: one having the code chunk with echo: true, results: hide and the other one with echo: false. To avoid problems when changing code in one and not in the other, it would be nice to have the possibility of code chunk reuse, as in Sweave. Are there any plans to implement this in the future? I know that there is something similar for Quarto interactive documents (observable JS) and I also understand that despite some external similarities between Sweave and Quarto, there are many deep technical differences behind the curtains. So it is just curiosity since this feature could be useful in several contexts. In any case, this feature and the previous bug are minor things compared with so many excellent features in Quarto and in RStudio. Thanks for this to everybody involved in it.