Package version: BiocStyle 2.2.1


1 Prerequisites

In order to build .Rmd documents the rmarkdown package is necessary, which relies on pandoc to compile the final output document. If you are working within a recent version of RStudio then both rmarkdown and pandoc should be already installed.

If you are missing the rmarkdown package then you can install it from CRAN using


In this case a recent version of pandoc (>= 1.12.3) is also required. See the pandoc installation instructions for details on installing pandoc for your platform.

2 Authoring R markdown HTML package vignettes

To enable the Bioconductor style in your markdown (.Rmd) vignettes you need to:

The vignette section is required in order to instruct R how to build the vignette. Note that the \VignetteIndexEntry should match the title of your vignette.

It is also possible to specify additional details such as:

as in the following example. Note the inclusion of an additional style sheet custom.css by specifying it in the document header.

title: "Vignette Title"
author: "Vignette Author"
date: "`r doc_date()`"
package: "`r pkg_ver('BiocStyle')`"
abstract: >
  Vignette Abstract
vignette: >
  %\VignetteIndexEntry{Vignette Title}
    css: custom.css

2.1 Use with R markdown v1

Apart from the default markdown engine implemented in the rmarkdown package, it is also possible to compile Bioconductor documents using the older markdown v1 engine from the package markdown. There are some differences in setup and the resulting output between these two engines.

To use the markdown vignette builder engine:

The way of attaching CSS files when using markdown differs from how this done with rmarkdown. In the former case additional style sheets can be used by providing them to the BiocStyle::markdown function. To include custom.css file use

```{r style, echo = FALSE, results = 'asis'}
BiocStyle::markdown(css.files = c('custom.css'))

3 Style macros

BiocStyle introduces the following macros useful when referring to R packages:

4 Additional formatting features

Compared to the default markdown appearance the formatting differences include:

Math symbols can be included in markdown documents. You can write math expressions the same way you would in Latex, except some differences in escaping them.

5 Session info

Here is the output of sessionInfo() on the system on which this document was compiled:

## R version 3.3.2 (2016-10-31)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 16.04.1 LTS
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## other attached packages:
## [1] BiocStyle_2.2.1
## loaded via a namespace (and not attached):
##  [1] backports_1.0.4 magrittr_1.5    rprojroot_1.1   htmltools_0.3.5
##  [5] tools_3.3.2     yaml_2.1.14     Rcpp_0.12.8     stringi_1.1.2  
##  [9] rmarkdown_1.2   knitr_1.15.1    stringr_1.1.0   digest_0.6.10  
## [13] evaluate_0.10