Title: | Standard styles for vignettes and other Bioconductor documents |
---|---|
Description: | Provides standard formatting styles for Bioconductor PDF and HTML documents. Package vignettes illustrate use and functionality. |
Authors: | Andrzej Oleś [aut] , Mike Smith [ctb] , Martin Morgan [ctb], Wolfgang Huber [ctb], Bioconductor Package Maintainer [cre] |
Maintainer: | Bioconductor Package Maintainer <[email protected]> |
License: | Artistic-2.0 |
Version: | 2.35.0 |
Built: | 2024-12-19 02:52:32 UTC |
Source: | https://github.com/bioc/BiocStyle |
These functions are defunct and no longer available.
The following functions are no longer available; use the replacement indicated below:
latex_old, latex2: latex
pdf_document_old, pdf_document2: pdf_document
html_document_old, html_document2: html_document
Helper functions for including metadata in the document header.
pkg_ver(pkg) doc_date()
pkg_ver(pkg) doc_date()
pkg |
character(1), package name |
Use doc_date
to include document compilation date in the document
metadata field 'date', and pkg_ver
for package version specification
in the 'package' field.
Markdown-formatted character string.
Andrzej Oleś <[email protected]>, 2014-2015
## current date doc_date() ## package name with version pkg_ver("BiocStyle")
## current date doc_date() ## package name with version pkg_ver("BiocStyle")
Format for converting from R Markdown to an Bioconductor HTML document.
html_document(toc = TRUE, number_sections = TRUE, fig_width = NA, fig_height = NA, self_contained = TRUE, css = NULL, pandoc_args = NULL, ..., titlecaps = TRUE)
html_document(toc = TRUE, number_sections = TRUE, fig_width = NA, fig_height = NA, self_contained = TRUE, css = NULL, pandoc_args = NULL, ..., titlecaps = TRUE)
toc |
logical(1), |
number_sections |
logical(1), |
fig_width |
numeric(1), default width (in inches) for figures |
fig_height |
numeric(1), default width (in inches) for figures |
self_contained |
numeric(1), |
css |
character, one or more css files to include |
pandoc_args |
character, additional command line options to pass to pandoc |
... |
Additional arguments passed to
|
titlecaps |
logical(1), |
BiocStyle::html_document
format extends the
html_document
format. See the
online
documentation and the package vignette "Authoring R Markdown Vignettes" for
additional details on using the format,
R Markdown output format to pass to render
Andrzej Oleś <[email protected]>, 2014-2017
## Not run: # simple invocation render("input.Rmd", BiocStyle::html_document()) # specify options render("input.Rmd", BiocStyle::html_document(toc = FALSE)) ## End(Not run)
## Not run: # simple invocation render("input.Rmd", BiocStyle::html_document()) # specify options render("input.Rmd", BiocStyle::html_document(toc = FALSE)) ## End(Not run)
This function inserts code into a document preamble to provide a consistent style to Bioconductor vignettes.
latex(..., width, titlecaps = TRUE, short.fignames = FALSE, fig.path, use.unsrturl = TRUE, relative.path = FALSE)
latex(..., width, titlecaps = TRUE, short.fignames = FALSE, fig.path, use.unsrturl = TRUE, relative.path = FALSE)
... |
Additional arguments, passed to |
width |
integer(1), maximum number of columns on a line used in
printing. See |
titlecaps |
logical(1), emphasize the first sentence of float captions |
short.fignames |
logical(1), indicates whether |
fig.path |
character(1), custom prefix to be used for figure file names
when used with |
use.unsrturl |
logical(1), indicating that the ‘unsrturl’ style
will be used ( |
relative.path |
logical(1), copy supporting LaTeX files and use relative paths rather than absolute paths to system files. |
Use is described in the ‘Bioconductor LaTeX Style 2.0’ vignette.
By default the 'unsrturl' bibliography style is used, which automatically
creates links to URL, DOIs, etc. Use a different bibliographystyle
with use.unsrturl=FALSE
and standard LaTeX commands for styling
bibliographies.
The return value is a character string directing LaTex to use the Bioconductor style file.
A side effect is setting any options specified as arguments.
Andrzej Oleś, Martin Morgan, Wolfgang Huber
## location of the .sty file BiocStyle:::bioconductor.sty
## location of the .sty file BiocStyle:::bioconductor.sty
Functions for adding links to Bioconductor, CRAN and GitHub packages into R Markdown documents.
Biocpkg(pkg, vignette = NULL, label = NULL) Biocbook(pkg, label = NULL) Biocannopkg(pkg) Biocexptpkg(pkg) CRANpkg(pkg) Rpackage(pkg) Githubpkg(repo, pkg)
Biocpkg(pkg, vignette = NULL, label = NULL) Biocbook(pkg, label = NULL) Biocannopkg(pkg) Biocexptpkg(pkg) CRANpkg(pkg) Rpackage(pkg) Githubpkg(repo, pkg)
pkg |
character(1), package name |
vignette |
character(1), basename of vignette link, including html or pdf extension, e.g., "work-0-intro.html". |
label |
character(1) label used to identify the package or
vignette. If |
repo |
Repository address in the format username/repo[/subdir] |
Use Biocpkg
for Bioconductor software, annotation,
experiment data, and workflow packages. When vignette=NULL
,
the function automatically includes a link to the package landing
page, the version of which depends on the current Bioconductor
version (i.e. if run in a devel environment, it will point towards
the devel landing page; otherwise it will point to the release
landing page).
Use Biocbook
for Bioconductor webbooks. This will create a
link to the index page of the book rather than to the landing page
of the package used for the book's deployment.
Use CRANpkg
for R packages available on CRAN. The function
automatically includes a link to the master CRAN landing page.
Use Githubpkg
for R packages available on GitHub. The repo
should include the repository address in the format username/repo[/subdir].
If package
is missing, the package name is assumed to be equal the
repository name and is extracted from repo
.
For R packages which are not available on Bioconductor, CRAN or GitHub, use
Rpackage
.
Markdown-formatted character vector containing a
hyperlinked package name. If vignette != NULL
, the
address of the specified vignette is returned.
Andrzej Oleś <[email protected]>, 2014-2015
## link to a Bioconductor software package Biocpkg("IRanges") ## link to a Bioconductor annotation package Biocpkg("org.Mm.eg.db") ## link to a Bioconductor experiment data package Biocpkg("affydata") ## link to a Bioconductor workflow Biocpkg("simpleSingleCell") Biocpkg( "simpleSingleCell", vignette = "work-0-intro.html", label = "Episode 1: analyzing scRNA-seq data with R/Bioconductor" ) ## link to a CRAN package CRANpkg("data.table") ## link to an R package on GitHub Githubpkg("rstudio/rmarkdown")
## link to a Bioconductor software package Biocpkg("IRanges") ## link to a Bioconductor annotation package Biocpkg("org.Mm.eg.db") ## link to a Bioconductor experiment data package Biocpkg("affydata") ## link to a Bioconductor workflow Biocpkg("simpleSingleCell") Biocpkg( "simpleSingleCell", vignette = "work-0-intro.html", label = "Episode 1: analyzing scRNA-seq data with R/Bioconductor" ) ## link to a CRAN package CRANpkg("data.table") ## link to an R package on GitHub Githubpkg("rstudio/rmarkdown")
This function sets the Bioconductor style sheet to provide a consistent style across Bioconductor HTML vignettes.
markdown(css.files, self.contained = TRUE, links.target = TRUE)
markdown(css.files, self.contained = TRUE, links.target = TRUE)
css.files |
character vector containing the location of additional
|
self.contained |
logical(1), should the content of the CSS
|
links.target |
logical(1), should external links open in new browser tab/window. |
Use is described in the ‘Bioconductor CSS Style’ vignette.
No value is returned. The function is called for its side effect of
setting the markdown
and/or knitr
specific options controlling
the inclusion of the Bioconductor CSS style file in the HTML output.
Andrzej Oleś <[email protected]>, 2014-2015
## location of the .css file BiocStyle:::bioconductor.css
## location of the .css file BiocStyle:::bioconductor.css
Enable BiocStyle macros and author affiliations in markdown documents.
md_document(toc = TRUE, ...)
md_document(toc = TRUE, ...)
toc |
|
... |
Additional function arguments to pass to the base R Markdown
|
The BiocStyle::md_document
format extends the base
md_document
format by means of specifing complex
author affiliations. It also loads the BiocStyle package namespace to enable
the use of helper functions, such as Biocpkg
.
R Markdown output format to pass to render
Andrzej Oleś <[email protected]>, 2015-2016
## Not run: rmarkdown::render("input.Rmd", BiocStyle::md_document()) ## End(Not run)
## Not run: rmarkdown::render("input.Rmd", BiocStyle::md_document()) ## End(Not run)
Helper function to determine the document's current pandoc output format.
output()
output()
The function is useful for defining different behavior depending on the output format, e.g. figure settings.
A character string specifying the pandoc output format.
Andrzej Oleś <[email protected]>, 2016
## Not run: ## Switch between SVG and PDF figures depending on document output format knitr::opts_chunk$set( dev = switch(output(), html = "svg", latex = "pdf") ) ## End(Not run)
## Not run: ## Switch between SVG and PDF figures depending on document output format knitr::opts_chunk$set( dev = switch(output(), html = "svg", latex = "pdf") ) ## End(Not run)
This function sets the Bioconductor style in PDF documents rendered using R Markdown v2.
pdf_document(toc = TRUE, number_sections = TRUE, fig_width = NA, fig_height = NA, includes = NULL, ..., titlecaps = TRUE, toc_newpage = FALSE, use_unsrturl = TRUE, relative_path = FALSE)
pdf_document(toc = TRUE, number_sections = TRUE, fig_width = NA, fig_height = NA, includes = NULL, ..., titlecaps = TRUE, toc_newpage = FALSE, use_unsrturl = TRUE, relative_path = FALSE)
toc |
logical(1), |
number_sections |
logical(1), |
fig_width |
numeric(1), default width (in inches) for figures |
fig_height |
numeric(1), default width (in inches) for figures |
includes |
Named list of additional content to include within the
document (typically created using the |
... |
Additional arguments passed to
|
titlecaps |
logical(1), |
toc_newpage |
logical(1), |
use_unsrturl |
logical(1), indicating that the ‘unsrturl’ style
will be used ( |
relative_path |
logical(1), copy supporting LaTeX files and use relative paths rather than absolute paths to system files. |
R Markdown output format to pass to render
.
Andrzej Oleś <[email protected]>, 2014-2017
## Not run: # simple invocation render("input.Rmd", BiocStyle::pdf_document()) # specify an option for latex engine render("input.Rmd", BiocStyle::pdf_document(toc = FALSE)) ## End(Not run)
## Not run: # simple invocation render("input.Rmd", BiocStyle::pdf_document()) # specify an option for latex engine render("input.Rmd", BiocStyle::pdf_document(toc = FALSE)) ## End(Not run)
Create 'Rmd' vignette templates for HTML or PDF output
use_vignette_html(destination = tempfile(fileext = ".Rmd")) use_vignette_pdf(destination = tempfile(fileext = ".Rmd"))
use_vignette_html(destination = tempfile(fileext = ".Rmd")) use_vignette_pdf(destination = tempfile(fileext = ".Rmd"))
destination |
character(1) file path to destination. The directory of the destination must already exist, and the file must not. The default creates a file in the temporary directory, and so is removed when the R session ends. |
use_vignette_html()
use_vignette_html()