Text and image side by side in Quarto column layout
Asked Answered
W

1

5

I would like to have a picture on the left side of a slide, and text on the right side. I am using Quarto reveal.js.

I would expect that with the .columns div, it should work, but this gives unexpected result. Same with using layout-ncol=2. Any ideas?

A reproducible example:

---
format: revealjs
---

## A title

::: {layout-ncol=2}

Some text that is very long and that should take most of the column space.

![](https://www.r-project.org/logo/Rlogo.png)

Some other text that should be below the first paragraph.

:::

## Another title

:::: .columns
::: {.column width=60%}

Some text that is very long and that should take most of the column space.

:::

::: {.column width=40%}

![](https://www.r-project.org/logo/Rlogo.png)

:::
::::
First slide Second slide
enter image description here enter image description here
Whitworth answered 7/6, 2023 at 9:24 Comment(0)
B
6

The quotation marks are missing, e.g. width=40 needs to be changed to width="40%":

---
format: revealjs
---

## A title

::: columns
::: {.column width="40%"}

![](https://www.r-project.org/logo/Rlogo.png)
:::

::: {.column width="60%"}

Some text that is very long and that should take most of the column space.

<br>

Some other text that should be below the first paragraph.

:::
:::

enter image description here

Bromine answered 7/6, 2023 at 9:37 Comment(4)
Yes! Well what is wrong with my code then?Stiffnecked
It seems that the percentage width="20%" needs to be in quotation marks..Bromine
Right!! Learning a "new" language always boils down to those little detailsStiffnecked
You also confused me with 'have a picture on the left side of a slide' and you put it on the right in your example :DBromine

© 2022 - 2024 — McMap. All rights reserved.