chapterPreamble: Execute chapter preamble code

Description Usage Arguments Details Value Author(s) Examples

View source: R/chapterPreamble.R

Description

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

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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))

rebook documentation built on Nov. 8, 2020, 4:56 p.m.