chapterPreamble: Execute chapter preamble code

View source: R/chapterPreamble.R

chapterPreambleR Documentation

Execute chapter preamble code

Description

Execute code to set up the compilation environment at the start of every chapter.

Usage

chapterPreamble(cache = TRUE)

Arguments

cache

Logical indicating whether to cache code chunks.

Details

Compilation is performed with no tolerance for errors, no printing of package start-up messages, and no printing of warnings.

Numbers are printed to 4 digits of precision.

The BiocStyle package is automatically attached, primarily for use of Biocpkg and similar functions.

HTML elements are defined using setupHTML.

Value

HTML is printed to standard output, see setupHTML.

Author(s)

Aaron Lun

Examples

tmp <- tempfile(fileext=".Rmd")
write(file=tmp, "```{r, echo=FALSE, results='asis'}
rebook::chapterPreamble()
```

```{r}
pi # four digits!
```

```{r}
warning('ASDASD') # warnings and messages are not saved in the HTML.
```

```{r, results='asis'}
prettySessionInfo()
```")

rmarkdown::render(tmp)

if (interactive()) browseURL(sub(".Rmd$", ".html", tmp))


LTLA/rebook documentation built on June 5, 2023, 6:24 p.m.