Skip to content

Instantly share code, notes, and snippets.

@sgibb
Created July 22, 2013 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgibb/6057514 to your computer and use it in GitHub Desktop.
Save sgibb/6057514 to your computer and use it in GitHub Desktop.
BiocStyle + knitr; try `library("knitr"); library("BiocStyle"); knit("knitr.Rnw"); tools::texi2pdf("knitr.tex")`
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{Bioconductor}[2013/07/01 Bioconductor vignette style]
%% -I would wish to know how to make this work-
%% \DeclareOption{pdftitle}{\PassOptionsToPackage{pdftitle}{hyperref}}
%% \DeclareOption{pdfauthor}{\PassOptionsToPackage{pdfauthor}{hyperref}}
%% \ExecuteOptions{pdftitle,pdfauthor}
%% \ProcessOptions
\PassOptionsToPackage{usenames,dvipsnames}{color}
\RequirePackage{color}
\definecolor{BiocBlue}{RGB}{24,129,194}
\definecolor{BiocGreen}{RGB}{135,177,63}
\RequirePackage[%
pdfpagelabels,%
plainpages=false,%
pdfborder={0 0 0},%
bookmarks=true,%
bookmarksopen=true,%
bookmarksnumbered=true,%
linktoc=section,%
linkcolor=BiocBlue,%
citecolor=BiocBlue,%
urlcolor=BiocBlue,%
citebordercolor={.7 .7 .7},%
linkbordercolor={.7 .7 .7},%
urlbordercolor={.7 .7 .7},%
raiselinks,%
pdfusetitle,%
pdftex]{hyperref}
\pdfpageattr{/Group << /S /Transparency /I true /CS /DeviceRGB>>} %fixes incorrect color rendering in acroread
\RequirePackage[left=2cm,top=2.5cm,bottom=2.5cm,right=2cm]{geometry}
\RequirePackage{graphicx}
\RequirePackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\RequirePackage{cite}
\pagestyle{empty}
%
\RequirePackage{sectsty}
\sectionfont{\sffamily\bfseries\color{BiocBlue}\sectionrule{0pt}{0pt}{-1ex}{1pt}}
\subsectionfont{\sffamily\bfseries\color{BiocBlue}}
\subsubsectionfont{\sffamily\bfseries\color{BiocBlue}}
%
%% Page layout
\RequirePackage{titling} %% captures \title{} as \thetitle for subsequent use
\RequirePackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\fancyhead[LE,RO]{\thepage}
\fancyhead[LO,RE]{\thetitle}
\renewcommand{\headrule}{}
%
\usepackage{enumitem}
\setlist{nolistsep}
%% Alter some LaTeX defaults for better treatment of floats
%% See p.105 of "TeX Unbound" for suggested values
\setcounter{topnumber}{2}
\setcounter{bottomnumber}{2}
\setcounter{totalnumber}{4}
\setcounter{dbltopnumber}{2}
\renewcommand\topfraction{0.9}
\renewcommand\bottomfraction{0.5}
\renewcommand\textfraction{0.1}
\renewcommand\floatpagefraction{0.9}
\renewcommand\dbltopfraction{0.9}
\renewcommand\dblfloatpagefraction{0.8}
%
\RequirePackage{Sweave}
%
\newcommand{\email}[1]{\href{mailto:#1}{\texttt{#1}}}
\newcommand{\file}[1]{'#1'}
\newcommand{\software}[1]{\textsl{#1}}
\newcommand\R{\software{R}}
\newcommand\Bioconductor{\software{Bioconductor}}
\newcommand\Biocpkg[1]{%
{\href{http://bioconductor.org/packages/release/bioc/html/#1.html}%
{\textsl{#1}}}}
\newcommand\Biocannopkg[1]{%
{\href{http://bioconductor.org/packages/release/data/annotation/html/#1.html}%
{\textsl{#1}}}}
\newcommand\Biocexptpkg[1]{%
{\href{http://bioconductor.org/packages/release/data/experiment/html/#1.html}%
{\textsl{#1}}}}
\newcommand\Rpkg[1]{%
{\href{http://cran.fhcrc.org/web/packages/#1/index.html}%
{\textsl{#1}}}}
\newcommand{\Rpackage}[1]{\textit{#1}}
\newcommand{\Rfunction}[1]{\texttt{#1}}
\newcommand{\Robject}[1]{\texttt{#1}}
\newcommand{\Rclass}[1]{\textit{#1}}
\newcommand{\Rcode}[1]{\texttt{#1}}
%
\newcommand{\comment}[1]{\textsl{\textcolor{Gray}{#1}}}
\newcommand{\warning}[1]{\textsl{\textcolor{Red}{warning: #1}}}
\newcommand{\fixme}[1]{\textsl{\textcolor{Bittersweet}{fixme: #1}}}
%
\newcommand{\incfig}[4]{%
\begin{figure}[tbp]
\begin{center}
\includegraphics[width=#2]{#1}
\caption[#3]{\label{#1}\textbf{#3} #4}
\end{center}
\end{figure}
}
\endinput
\documentclass{article}
\usepackage{Bioconductor-patched}
<<style, eval=TRUE, echo=FALSE, results="asis">>=
BiocStyle::latex()
@
\author{Sebastian Gibb%
\thanks{\email{mail@sebastiangibb.de}}
}
\date{\today}
\title{Minimal Example}
\begin{document}
<<boring-random>>=
set.seed(1121)
(x=rnorm(20))
mean(x);var(x)
@
\end{document}
\documentclass{article}
<<style, eval=TRUE, echo=FALSE, results="asis">>=
BiocStyle::latex()
@
\author{Sebastian Gibb%
\thanks{\email{mail@sebastiangibb.de}}
}
\date{\today}
\title{Minimal Example}
\begin{document}
<<boring-random>>=
set.seed(1121)
(x=rnorm(20))
mean(x);var(x)
@
\end{document}
\documentclass{article}
\usepackage{Bioconductor-patched}
\author{Sebastian Gibb%
\thanks{\email{mail@sebastiangibb.de}}
}
\date{\today}
\title{Minimal Example}
\begin{document}
<<boring-random>>=
set.seed(1121)
(x=rnorm(20))
mean(x);var(x)
@
\end{document}
\documentclass{article}
<<style, eval=TRUE, echo=FALSE, results=tex>>=
BiocStyle::latex()
@
\author{Sebastian Gibb%
\thanks{\email{mail@sebastiangibb.de}}
}
\date{\today}
\title{Minimal Example}
\begin{document}
<<boring-random>>=
set.seed(1121)
(x=rnorm(20))
mean(x);var(x)
@
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment