I'm trying to wrap text around a right-floated image. It will be a page on a Distill website. I'm working in RStudio.
Here is the text:
Vivamus venenatis egestas eros ut tempus. Vivamus id est nisi. Aliquam molestie erat et sollicitudin venenatis. In ac lacus at velit scelerisque mattis.
Vivamus venenatis egestas eros ut tempus. Vivamus id est nisi. Aliquam molestie erat et sollicitudin venenatis. In ac lacus at velit scelerisque mattis.
```{r out.width='30%', out.extra='style="float:right; padding:10px"'}
knitr::include_graphics("images/CXR.jpg")
```
Vivamus venenatis egestas eros ut tempus. Vivamus id est nisi. Aliquam molestie erat et sollicitudin venenatis. In ac lacus at velit scelerisque mattis.
I believe this is a specificity of the distill framework. You need to customize further the CSS.
If you look at the source of the HTML page, you'll see that the image and the following paragraph are not in the same div. Which impact the way the float works. If you use html_document your CSS should work for example. This is because of the special features for figures:
It seems that adding a div for your text and your figure will get you the expected result. You can add a div using Pandoc fenced div feature for custom block, useful for customizing a document
---
title: test
output:
distill::distill_article: default
---
Vivamus venenatis egestas eros ut tempus. Vivamus id est nisi. Aliquam molestie erat et sollicitudin venenatis. In ac lacus at velit scelerisque mattis.
Vivamus venenatis egestas eros ut tempus. Vivamus id est nisi. Aliquam molestie erat et sollicitudin venenatis. In ac lacus at velit scelerisque mattis.
::: {.floatting}
```{r out.width='30%', out.extra='style="float:right; padding:10px"'}
knitr::include_graphics("Rlogo.svg")
```
Vivamus venenatis egestas eros ut tempus. Vivamus id est nisi. Aliquam molestie erat et sollicitudin venenatis. In ac lacus at velit scelerisque mattis.
:::
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: