File: knitr-template.Rnw

package info (click to toggle)
r-cran-knitr 1.50%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,864 kB
  • sloc: makefile: 16; sh: 10; javascript: 8
file content (60 lines) | stat: -rw-r--r-- 1,671 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
\documentclass{article}
\usepackage[sc]{mathpazo}
\renewcommand{\sfdefault}{lmss}
\renewcommand{\ttdefault}{lmtt}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\usepackage[unicode=true,pdfusetitle,
 bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=2,
 breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
 {hyperref}
\hypersetup{
 pdfstartview={XYZ null null 1}}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\renewcommand{\textfraction}{0.05}
\renewcommand{\topfraction}{0.8}
\renewcommand{\bottomfraction}{0.8}
\renewcommand{\floatpagefraction}{0.75}

\makeatother

\begin{document}

<<setup,include=FALSE,cache=FALSE>>=
options(width=90)
knitr::opts_chunk$set(out.width = '.6\\linewidth')
.knitr.title = if (exists('.knitr.title')) paste('\\title{', .knitr.title, '}', sep = '') else ''
.knitr.author = if (nzchar(.knitr.title) && exists('.knitr.author')) {
  paste('\\author{', .knitr.author, '%\n',
        '\\thanks{This report is automatically generated with the R package \\textbf{knitr}
        (version ', packageVersion('knitr'), ').}}', sep = '')
} else ''
@

\Sexpr{.knitr.title}

\Sexpr{.knitr.author}

\Sexpr{if (nzchar(.knitr.title)) '\\maketitle'}
The results below are generated from an R script.

<<%sCHUNK_LABEL_HERE>>=
@

The R session information (including the OS info, R version and all
packages used):

<<session-info, cache=FALSE>>=
sessionInfo()
Sys.time()
@
<<clean-up, include=FALSE>>=
rm(.knitr.author); rm(.knitr.author)
@

\end{document}