Open dragonstyle opened 1 year ago
Hello there, Based on Yihui Xie's webpage on chunk options, I was able to get code chunk and figure side by side in Quarto HTML using code as follows:
:::: {.columns}
:::{.column}
```{r}
#| label: plot1
#| eval: false
library(tidyverse)
library(ggformula)
library(palmerpenguins)
# Set graph theme
theme_set(new = theme_classic())
penguins %>%
gf_point(body_mass_g ~ flipper_length_mm,
colour = ~ species,
title = "Penguins Scatter Plot")
:::
:::{.column}
#| ref.label: "plot1"
#| echo: false
:::
::::
Working nicely for me! Give it a try!!
@arvindvenkatadri
Could you properly format your post using code blocks for code and terminal outputs? Thanks.
If your code contains code blocks, you need to enclose it using more backticks, i.e., usually four ````
.
See https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us.
Note that this issue is not about "how to have things side by side?" But really about supporting an option without requiring any other markup to get the results.
@mcanouil I have reformatted my comment.
I did think, and still think, that the outcome desired by @dragonstyle is to have a code chunk and its output graph side by side, as with revealjs, and what I have posted does exactly that for an HTML document. Yes, it does require more markup as you observe, but since that feature is slated for the future, this is a good solution for now, no? I am quite the newbie at Quarto so I could be wrong!
@arvindvenkatadri As I said, using column fenced div or layout is documented (e.g., https://quarto.org/docs/presentations/index.html#multiple-columns). This issue is really about extending the YAML option for code cell. There are various alternatives such as https://github.com/quarto-dev/quarto-cli/discussions/9646
Discussed in https://github.com/quarto-dev/quarto-cli/discussions/3151