Quarto book_start Equivalent


I'm looking to convert a current bookdown book into a quarto book. The _bookdown.yml file contains the following line:

before_chapter_script: "book_start.R"

I found this query online which may be relevant to my question. If so, would pre-render be the equivalent to before_chapter_script in quarto?

Thanks in advance.

There is not exact equivalent to that in Quarto as the overall rendering process is a bit different. Depending on what you are doing in book_start.R, pre-render could be a replacement. Difference will be that what you do in pre-render won't be kept in the R session for rendering the .qmd document.

The solution replacement would be to have a setup chunk in all document like this

```{r, setup, file = "book_start.R", include = FALSE}

which could added as is in all docs, or put in a separate _setup.qmd file that you could load using

  • usual Rmd way
```{r, child = "_setup.qmd", include = FALSE}
{{< include _setup.qmd >}}

I believe all of this would work fine.

However, I understand that the bookdown feature is something that some people where relying on for new_session: true configuration. An equivalent of the rendering process could be considered in the future.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.