-
DescriptionHi! I've spent more time than I'd like to admit today trying to get text to wrap around a .jpg image in a .qmd file as part of a book format. The only relevant item I've seen in dozens of google searches has been: https://forum.posit.co/t/picture-and-text-side-by-side-on-quarto/147682 but I haven't been able to get this to run in a .qmd. It just prints out the text verbatim from source. I understand there's a css float function but I'm not sure how to apply this to a single image and text paragraph at a time. I have tried multiple ways with no success. I can get somewhat close with multi-column or custom layout (like below) but it looks very clunky with a large gap in one column. ::: {layout="[2,1]"} Any help would be most welcome. Thanks, Quarto Version: 1.5.56 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Do you have an example of what output you are targeting ?
Float in CSS would help indeed. You can search the web for how to do it, and then use raw HTML or associated .md syntax. For example : ---
title: "Untitled"
format: html
---
## Test
::: {.img-float}
{style="float: left; margin: 5px;"}
:::
{{< lipsum 2 >}}
You can adapt by using classes and a CSS style (or quarto scss theme addition). This will only work for HTML though. Hope it helps |
Beta Was this translation helpful? Give feedback.
-
I'm pretty sure there are already few discussions about this or at least related discussion for LaTeX/PDF: |
Beta Was this translation helpful? Give feedback.
The best way to figure out HTML/CSS is to use your favourite browser inspect/developer mode.
as explained by Christophe
float
property is the solution with or without caption, since we cannot cover all the cases, you have to adapt yourself the suggested solution.