gadenbuie / xaringanExtra

:ferris_wheel: A playground of enhancements and extensions for xaringan slides.
https://pkg.garrickadenbuie.com/xaringanExtra
Other
448 stars 36 forks source link

panelest: code and output panels not auto-generating #63

Closed evanmorier closed 4 years ago

evanmorier commented 4 years ago

I'm trying to use panelset to have panels auto-created for R code chunks as discussed and demoed here: https://pkg.garrickadenbuie.com/xaringanExtra/panelset/?panelset1=chunk-1#3

However, the auto-generating feature is not working. Instead, the code and output appear as in any ordinary R code chunk, i.e. just code first then output right below it. For example, the following code:

## test

```{r panelset = TRUE}
list(
  normal = rnorm(10),
  uniform = runif(10),
  cauchy = rcauchy(10)
)


produces this slide:

![panelset2](https://user-images.githubusercontent.com/47162016/94356214-467ed400-0051-11eb-929a-ab6511e8b8bd.PNG)

I tracked down the [source code](https://github.com/gadenbuie/xaringanExtra/blob/master/docs/panelset/index.Rmd) for the panelset demo slides and tried knitting them on my machine, which produces the same error:

![panelsettestscreengrab](https://user-images.githubusercontent.com/47162016/94356084-e3407200-004f-11eb-961f-d9bf6a14a2bc.PNG)

Apologies if I'm missing something obvious here. I tried rolling back to R 3.6 but that didn't fix it. The package is super helpful and I'm hoping to use this feature too. Thanks!
gadenbuie commented 4 years ago

Does this work for you?


## test

.panelset[

```{r panelset = TRUE}
list(
  normal = rnorm(10),
  uniform = runif(10),
  cauchy = rcauchy(10)
)

]



The docs aren't very clear but the panelset chunk still needs to be inside a `.panelset[]`. 

If that doesn't work, can you share the full slide source code, maybe as a [gist](https://gist.github.com)?
evanmorier commented 4 years ago

Still no luck unfortunately. Here's a gist with the test file I used: https://gist.github.com/evanmorier/45f971fd3bb0ec34957ea1ccca898739

gadenbuie commented 4 years ago

Thanks for sharing the gist! I just tried it and it works for me, so now I'm wondering what package versions you're using. Can you run the following code and share the output?

devtools::session_info(c("xaringanExtra", "xaringan", "rmarkdown", "knitr"))
evanmorier commented 4 years ago

Sure!

sessioninfo

gadenbuie commented 4 years ago

Thanks, I see the problem now! You have xaringanExtra from this commit which was published two days before the panelset chunks landed.

Try updating xaringanExtra and you should be good to go. (If that does work for you can you please close this issue? Thanks!)

FYI and future reference, since things have been changing quickly lately with xaringanExtra I have a changelog to track when features are added or updated.

evanmorier commented 4 years ago

Ah man, sorry about that! I didn't realize it was part of an update. Updating fixed it. Thanks for troubleshooting, this is going to be super helpful! I'll keep an eye on things for future updates.