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

Error knitting R Markdown to HTML when there is more than one panelset in version 0.5.5 #143

Closed dunstone-a closed 2 years ago

dunstone-a commented 2 years ago

Hi, some colleagues and I are having a problem with the latest version of xaringanExtra (0.5.5) where R Markdown's fail to knit to HTML when there is more than one panel set. The error has the following form:

Error: C stack usage 7970416 is too close to the limit Execution halted

The Rmarkdown below knits without any problems using xaringanExtra version 0.5.4, but fails to knit with version 0.5.5.

---
title: "Panelset test with xaringanExtra new version"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)

First panelset

# NOTE: The following is a workaround to the lack of support for tabsets in 
#       distill (see https://github.com/rstudio/distill/issues/11 and 
#       https://github.com/rstudio/distill/issues/11#issuecomment-692142414 in 
#       particular).
xaringanExtra::use_panelset()

::::: {.panelset}

::: {.panel}

Panel_1 {.panel-name}

plot(1:1)

:::

::: {.panel}

Panel_2 {.panel-name}

plot(1:2)

:::

:::::

Second panelset

Having more than one panelset is broken in the new version of xaringanExtra.

The section below will have the following error if you are on version 0.5.5, but is fine with version 0.5.4.

Error: C stack usage 7975952 is too close to the limit Execution halted

# Working version for the lock.file
    "xaringanExtra": {
      "Package": "xaringanExtra",
      "Version": "0.5.4",
      "Source": "GitHub",
      "RemoteType": "github",
      "RemoteHost": "api.github.com",
      "RemoteUsername": "gadenbuie",
      "RemoteRepo": "xaringanExtra",
      "RemoteRef": "master",
      "RemoteSha": "5e2d80bd0c53065cf1c3e55c3f21efb28c44ab5d",
      "Hash": "f1b63f81a9dedddd43929543a847a739"
xaringanExtra::use_panelset()

::::: {.panelset}

::: {.panel}

Panel_1 {.panel-name}

plot(1:10)

:::

::: {.panel}

Panel_2 {.panel-name}

plot(1:9)

:::

:::::



Thanks in advance
gadenbuie commented 2 years ago

Can you share the reprex Rmd source directly? If you write 4 back ticks, paste the source contents, then close with 4 back ticks, you can add the document to the issue.

I tend to triage/respond to issues in my personal packages in stolen moments on my phone, where I can't open uploaded files.

dunstone-a commented 2 years ago

Ah thank you I tried with 3 backticks and that wasn't working. I have added it now.

gadenbuie commented 2 years ago

Ah I see, and thanks for updating! Can you avoid the second use_panelset() or is there a reason you need (or end up with) both in the same document?

You only need one call, and apparently calling it more than once leads to problems. But you can have as many panel sets as you want in a document as long as you called use_panelset() one time in the doc.

dunstone-a commented 2 years ago

Ah that makes sense, I didn't realise the panelsets would work without calling use_panelset() each time but that is easy to change. Things are knitting as expected now. Thanks for the reply!