Display Code Cell Source Separately
For example, let’s take the following code cell using the fenced output to ensure options are passed forward.
```{r}
#| echo: fenced
#| eval: true
1 + 1
```
Using the {quarto-panelize} extension, you can show the code cell and its output together in one tab, and separately display the source of the code cell with nearly all options (minus echo
) in another tab tab. Here’s how it can be done:
:::{.to-source}```{r}
#| echo: fenced
#| eval: true
1 + 1
```
:::
This will create two tabs: Result and Source.
1 + 1
[1] 2
```{r}
#| eval: true
1 + 1
```
Without setting echo: fenced
, the Source tab will only display the code without results.
1 + 1
[1] 2
1 + 1