To enable the Bioconductor style in your R Markdown vignette you need to include the following in the DESCRIPTION
file:
VignetteBuilder: knitr Suggests: BiocStyle, knitr, rmarkdown
BiocStyle introduces the following macros for referring to R packages:
r Biocpkg("IRanges")
, for Bioconductor software, annotation and experiment data packages,r CRANpkg("data.table")
, for R packages available on CRAN,r Githubpkg("rstudio/rmarkdown")
, for R packages available on GitHub,r Rpackage("MyPkg")
, for R packages that are not available on Bioconductor, CRAN or GitHub.Assign captions to figures in the code chunk option fig.cap
to automatically number them, and to be able to reference them, see Figure \@ref(fig:plot). The figure label is generated from the code chunk label by prefixing it with fig:
.
plot(cars)
Small and wide figures can be specified by fig.small
and fig.wide
code chunk options.
plot(cars)
plot(cars)
To number and reference equations, put them in equation environments and assign labels to them, see Equation \@ref(eq:binom).
\begin{equation} f\left(k\right) = \binom{n}{k} p^k\left(1-p\right)^{n-k} (#eq:binom) \end{equation}
Like figures, tables with captions will also be numbered and can be referenced, see Table \@ref(tab:table).
Fruit | Price ------- | ----- bananas | 1.2 apples | 1.0 oranges | 2.5
: (#tab:table) A simple table. With caption.
Apart from referencing figures (Section \@ref(figures)), tables (Section \@ref(tables)), and equations (Section \@ref(equations)), you can also use the same syntax to refer to sections by their default labels generated by pandoc.
Footnotes are displayed as side notes on the right margin^[this is a side note entered as a footnote], which has the advantage that they appear close to the place where they are defined.
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.