Closed ColinConwell closed 3 years ago
I'm inclined to think that a workaround exists, but there's also a chance that something very distill specific is at play here. If you could share a reprex it would greatly increase the chances that I would tinker with it and find a solution.
Thanks for the response! I'm not entirely sure the right way to copy and paste this over, but here's the reproducible example:
---
title: 'Xaringan Panels in Distill'
output:
distill::distill_article:
self_contained: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
Photo Credit: the beautiful Hypocalypse distill page: https://hypocolypse.github.io/
Ideally, these panels (or at least the images within them) will extend across the page (set in distill with layout='l-page').
xaringanExtra::use_panelset()
::::: {.panelset}
::: {.panel}
knitr::include_graphics('https://hypocolypse.github.io/assets/banner.png')
:::
::: {.panel}
knitr::include_graphics('https://hypocolypse.github.io/assets/banner.png')
:::
::: {.panel}
knitr::include_graphics('https://hypocolypse.github.io/assets/banner.png')
:::
:::::
Quick fix for this is to wrap the whole panelset in a div with the desired class, like l-page
or l-body-outset
To do this, you can use the :::
notation to create a div. I just tried this with the example above and it worked:
:::l-page
::::: {.panelset}
::: {.panel}
#### PANEL 1 {.panel-name}
```{r, layout='l-page'}
knitr::include_graphics('https://hypocolypse.github.io/assets/banner.png')
:::
::: {.panel}
knitr::include_graphics('https://hypocolypse.github.io/assets/banner.png')
:::
::: {.panel}
knitr::include_graphics('https://hypocolypse.github.io/assets/banner.png')
:::
:::::
:::
thanks, @jhelvy -- phenomenal fix. I reckon we can close this for now.
Awesome, thanks again @jhelvy!
use_panelset() works beautifully in distill_articles, except that at the moment they don't seem to respect wider layouts for figures and the like (e.g. layout='l-screen-inset'). is there a workaround for this?