-
Notifications
You must be signed in to change notification settings - Fork 2
/
skeleton.Rmd
212 lines (162 loc) · 5.46 KB
/
skeleton.Rmd
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
---
title: Template for RFMO working papers
author:
- name: Alice Anonymous
email: alice@example.com
corresponding_author: TRUE # Automatic author note including email address
affiliation:
- ABC
- DEF
- name: Bob Security
email: bob@example.com
affiliation: DEF
footnote: 1 # Author note using reference
- name: Cat Memes
email: cat@anotheru.edu
affiliation: Another University
footnote:
- 1
- 2
address:
- code: ABC
address: University of Somewhere
- code: DEF
address: Address in one element deprecated, but works
- code: Another University
address: Address for Another University
footnote:
- code: 1
text: "Equal contribution"
- code: 2
text: "Current email address: [cat@example.com](mailto:cat@example.com)"
#classoptions:
# - a4paper # Can also be here
bibliography: mybibfile.bib
csl: dmk-format.csl # Use any CSL style. Ignored if citation_package: natbib
link-citations: TRUE
output:
pdf_document:
keep_tex: TRUE
template: template.tex
md_extensions: "-autolink_bare_uris"
number_sections: TRUE
citation_package: default # Can also be "natbib"
lang: en # Main document language in BCP47 format
geometry: "margin=25mm"
papersize: a4
#linestretch: 2 # for double spacing
endfloat: TRUE
numberlines: FALSE
authblk: FALSE # Set to false to put author affiliations in footnotes
urlcolor: blue
linkcolor: blue
citecolor: blue
graphics: TRUE
tables: TRUE
fancyhdr:
first:
headleft: "Report No. 1"
headright: "Kaplan et al. (2021)"
headrulewidth: 0pt
#footleft: A left foot
footrulewidth: 0pt
subsequent:
headright: "*Kaplan et al. (2021)*" # Italics
headrulewidth: 1pt
footrulewidth: 0pt
#header-includes:
# - \usepackage[nomarkers,tablesfirst]{endfloat} # For figures and tables at end
# - \usepackage{lineno}\linenumbers # For line numbering
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE) # By default, hide code; set to TRUE to see code
knitr::opts_chunk$set(fig.pos = 'th') # Places figures at top or here
knitr::opts_chunk$set(out.width = '100%', dpi=300) # Figure resolution and size
knitr::opts_chunk$set(fig.env="figure") # Latex figure environment
options(knitr.table.format="latex") # For kable tables to work without setting format option
```
::: {.abstract data-latex="" lang=en}
An abstract text.
Second paragraph.
:::
::: {.keywords data-latex="" lang=en}
Keyword1; Keyword2
:::
<!-- Define as portuguese as spanish causes weird failure -->
<!-- Use class renameableabstract to give abstract a different title -->
::: {.renameableabstract data-latex="[Resumen]" lang=pt}
Un poco de texto.
:::
::: {.keywords data-latex="[Palabras Claves]" lang=pt}
Palabra1; Palabra2
:::
::: {.abstract data-latex="" lang=fr}
Un peu de texte.
:::
::: {.keywords data-latex="[Mots clés]" lang=fr}
Mot1; Mot2
:::
# Introduction
This template is a generic paper template that can be used for lots of tasks, including creating working group papers and as a starter format for publications for which one has not yet decided on a final format.
## A subsection
A numbered list:
1) First point
2) Second point
- Subpoint
A bullet list:
* First point
* Second point
# Literature citations
By default, citations are handled using CSQL style files, but `natbib` citations are also possible.
Here are two sample references:
* **author (year) example:** @horvath2018dna showed some really cool things.
* **(author year) example:** This is a well known result [@ji20123d].
The bibliography will appear at the end of the document.
# Equations
An equation without a label for cross-referencing:
$$
E=mc^2
$$
An inline equation: $y=ax+b$
An equation with a label for cross-referencing:
\begin{equation}\label{eq:eq1}
\int^{r_2}_0 F(r,\varphi){\rm d}r\,{\rm d}\varphi = 1
\end{equation}
This equation can be referenced as follows: Eq. \ref{eq:eq1}
# Inserting R figures
The code below creates a figure. The code is included in the output because `echo=TRUE`.
```{r fig1, fig.cap="This is the first figure.",echo=TRUE}
plot(1:10,main="Some data",xlab="Distance (cm)",
ylab="Time (hours)")
```
You can reference this figure as follows: Fig. \ref{fig:fig1}.
# Tables
## Generate a table using `xtable`
```{r xtabletable, results="asis", echo=TRUE}
df = data.frame(ID=1:3,code=letters[1:3])
# Creates tables that follow OUP guidelines
# using xtable
library(xtable)
print(xtable(df,caption="This is a xtable table.",
label="tab:tab1"),
comment=FALSE,caption.placement="top")
```
You can reference this table as follows: Table \ref{tab:tab1}.
## Generate a table using `kable`
```{r kabletable, echo=TRUE}
df = data.frame(ID=1:3,code=letters[1:3])
# kable can alse be used for creating tables
knitr::kable(df,caption="This is a kable table.",
#format="latex",
booktabs=TRUE,label="tab2")
```
You can reference this table as follows: Table \ref{tab:tab2}.
# Cross-referencing sections
You can cross-reference sections and subsections as follows: Section \ref{literature-citations} and Section \ref{a-subsection}.
For more portable and flexible referencing of sections, equations, figures and tables, use [`bookdown::pdf_document2`](https://github.com/rstudio/bookdown).
***Note:*** the last section in the document will be used as the section title for the bibliography.
<!-- An unnumbered section with the acknowledgements-->
# Acknowledgements {-}
This is an acknowledgement.
It consists of two paragraphs.
# References