I am using the K-M approach in bookdown
, so each chapter starts with a clean slate when compiled separately. However, I do want some common code (library, loading of larger data sets) to be available globally.
To work on single chapters, I can include the common code with include_before_script, but this implies that on building the whole book the code is executed multiple times, which is time-consuming.
How can I do an "include_before_build" equivalent?