Replies: 2 comments 4 replies
-
I guess it would be leveraging block layout: https://quarto.org/docs/authoring/figures.html#block-layout With latest Quarto 1.6 pre-release, we added a feature to reuse code cell output. So you could now to that manually. See pre-release doc: https://prerelease.quarto.org/docs/authoring/contents.html Something like ---
title: Layout plot / code
format: html
---
## A section
:::: {layout="[ 40, 60 ]"}
::: {#first-column}
Here we define a plot.
```{python}
#| label: a-cell
import matplotlib.pyplot as plt
plt.plot([1,2,3])
```
:::
::: {#second-column}
See the plot
{{< contents a-cell >}}
:::
:::: However, it seems we have an issue with Python cell and layout - we put the code cell outside always ! ---
title: Layout plot / code
format: html
---
## A section
:::: {layout="[ 40, 60 ]"}
::: {#first-column}
Here we define a plot.
```{python}
#| label: a-cell
import matplotlib.pyplot as plt
plt.plot([1,2,3])
```
:::
::: {#second-column}
Comment
:::
::::
This is surprising to me - but I remember a discussion about this somewhere. I'll find it. @cscheid would you have expected this to be a good usage of |
Beta Was this translation helpful? Give feedback.
-
possible workaround - just sharing for reference Duplicating the code cell and have one evaluate while the other no would make this possible. Not ideal. ---
title: Layout plot / code
format: html
---
## A section
:::: {.columns}
::: {.column width=40%}
Here we define a plot.
```{python}
#| eval: false
import matplotlib.pyplot as plt
plt.plot([1,2,3])
```
:::
::: {.column width=60%}
See the plot
```{python}
#| echo: false
#| label: a-cell
import matplotlib.pyplot as plt
plt.plot([1,2,3])
```
:::
::::
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Quarto's documentation for presentation shows there is an
output-location
option for revealjs. Is there a similar option for html output? I have a website with python code and I would like plots to be rendered side by side.I can try to store the result in a variable and then use a two column setup with the code in column A, and
{python} result
in column B.Is there a cleaner way?
Beta Was this translation helpful? Give feedback.
All reactions