LaTeX Utilities for Vignettes

Usage

latex_preamble(PACKAGE, R = TRUE, CRAN = TRUE, Bioconductor = TRUE, GEO = TRUE, ArrayExpress = TRUE, 
  biblatex = FALSE, only = FALSE, file = "")

latex_bibliography(PACKAGE, file = "")

Arguments

R
logical that indicate if general R commands should be added (e.g. package names, inline R code format commands)
CRAN
logical that indicate if general CRAN commands should be added (e.g. CRAN package citations)
Bioconductor
logical that indicate if general Bioconductor commands should be added (e.g. Bioc package citations)
GEO
logical that indicate if general GEOmnibus commands should be added (e.g. urls to GEO datasets)
ArrayExpress
logical that indicate if general ArrayExpress commands should be added (e.g. urls to ArrayExpress datasets)
biblatex
logical that indicates if a \bibliography command should be added to include references from the package's REFERENCES.bib file.
only
a logical that indicates if the only the commands whose dedicated argument is not missing should be considered.
file
connection where to print. If NULL the result is returned silently.
PACKAGE
package name

Description

latex_preamble outputs/returns command definition LaTeX commands to be put in the preamble of vignettes.

latex_bibliography prints or return a LaTeX command that includes a package bibliography file if it exists.

Details

Argument PACKAGE is not required for latex_preamble, but must be correctly specified to ensure biblatex=TRUE generates the correct bibliography command.

Examples

latex_preamble()
%%%% PKGMAKER COMMANDS %%%%%% \usepackage{xspace} % R \let\proglang=\textit \let\code=\texttt \newcommand{\Rcode}{\code} \newcommand{\pkgname}[1]{\textit{#1}\xspace} \newcommand{\Rpkg}[1]{\pkgname{#1} package\xspace} \newcommand{\citepkg}[1]{\cite{#1}} % CRAN \newcommand{\CRANurl}[1]{\url{http://cran.r-project.org/package=#1}} %% CRANpkg \makeatletter \def\CRANpkg{\@ifstar\@CRANpkg\@@CRANpkg} \def\@CRANpkg#1{\href{http://cran.r-project.org/package=#1}{\pkgname{#1}}\footnote{\CRANurl{#1}}} \def\@@CRANpkg#1{\href{http://cran.r-project.org/package=#1}{\pkgname{#1}} package\footnote{\CRANurl{#1}}} \makeatother %% citeCRANpkg \makeatletter \def\citeCRANpkg{\@ifstar\@citeCRANpkg\@@citeCRANpkg} \def\@citeCRANpkg#1{\CRANpkg{#1}\cite*{Rpackage:#1}} \def\@@citeCRANpkg#1{\CRANpkg{#1}~\cite{Rpackage:#1}} \makeatother \newcommand{\CRANnmf}{\href{http://cran.r-project.org/package=NMF}{CRAN}} \newcommand{\CRANnmfURL}{\url{http://cran.r-project.org/package=NMF}} % Bioconductor \newcommand{\BioCurl}[1]{\url{http://www.bioconductor.org/packages/release/bioc/html/#1.html}} \newcommand{\BioCpkg}[1]{\href{http://www.bioconductor.org/packages/release/bioc/html/#1.html}{\pkgname{#1}} package\footnote{\BioCurl{#1}}} \newcommand{\citeBioCpkg}[1]{\BioCpkg{#1}~\cite{Rpackage:#1}} % Bioconductor annotation \newcommand{\BioCAnnurl}[1]{\url{http://www.bioconductor.org/packages/release/data/annotation/html/#1.html}} \newcommand{\BioCAnnpkg}[1]{\href{http://www.bioconductor.org/packages/release/data/annotation/html/#1.html}{\Rcode{#1}} annotation package\footnote{\BioCAnnurl{#1}}} \newcommand{\citeBioCAnnpkg}[1]{\BioCAnnpkg{#1}~\cite{Rpackage:#1}} % GEO \newcommand{\GEOurl}[1]{\href{http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=#1}{#1}\xspace} \newcommand{\GEOhref}[1]{\GEOurl{#1}\footnote{\url{http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=#1}}} % ArrayExpress \newcommand{\ArrayExpressurl}[1]{\href{http://www.ebi.ac.uk/arrayexpress/experiments/#1}{#1}\xspace} \newcommand{\ArrayExpresshref}[1]{\ArrayExpressurl{#1}\footnote{\url{http://www.ebi.ac.uk/arrayexpress/experiments/#1}}} %%%% END: PKGMAKER COMMANDS %%%%%%
latex_preamble(R=TRUE, only=TRUE)
%%%% PKGMAKER COMMANDS %%%%%% \usepackage{xspace} % R \let\proglang=\textit \let\code=\texttt \newcommand{\Rcode}{\code} \newcommand{\pkgname}[1]{\textit{#1}\xspace} \newcommand{\Rpkg}[1]{\pkgname{#1} package\xspace} \newcommand{\citepkg}[1]{\cite{#1}} %%%% END: PKGMAKER COMMANDS %%%%%%
latex_preamble(R=FALSE, CRAN=FALSE, GEO=FALSE)
%%%% PKGMAKER COMMANDS %%%%%% \usepackage{xspace} % Bioconductor \newcommand{\BioCurl}[1]{\url{http://www.bioconductor.org/packages/release/bioc/html/#1.html}} \newcommand{\BioCpkg}[1]{\href{http://www.bioconductor.org/packages/release/bioc/html/#1.html}{\pkgname{#1}} package\footnote{\BioCurl{#1}}} \newcommand{\citeBioCpkg}[1]{\BioCpkg{#1}~\cite{Rpackage:#1}} % Bioconductor annotation \newcommand{\BioCAnnurl}[1]{\url{http://www.bioconductor.org/packages/release/data/annotation/html/#1.html}} \newcommand{\BioCAnnpkg}[1]{\href{http://www.bioconductor.org/packages/release/data/annotation/html/#1.html}{\Rcode{#1}} annotation package\footnote{\BioCAnnurl{#1}}} \newcommand{\citeBioCAnnpkg}[1]{\BioCAnnpkg{#1}~\cite{Rpackage:#1}} % ArrayExpress \newcommand{\ArrayExpressurl}[1]{\href{http://www.ebi.ac.uk/arrayexpress/experiments/#1}{#1}\xspace} \newcommand{\ArrayExpresshref}[1]{\ArrayExpressurl{#1}\footnote{\url{http://www.ebi.ac.uk/arrayexpress/experiments/#1}}} %%%% END: PKGMAKER COMMANDS %%%%%%
latex_preamble(GEO=TRUE, only=TRUE)
%%%% PKGMAKER COMMANDS %%%%%% \usepackage{xspace} % GEO \newcommand{\GEOurl}[1]{\href{http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=#1}{#1}\xspace} \newcommand{\GEOhref}[1]{\GEOurl{#1}\footnote{\url{http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=#1}}} %%%% END: PKGMAKER COMMANDS %%%%%%