Template for Oxford University Press papers In rticles: Article Formats for R Markdown

knitr::opts_chunk$set(echo = FALSE) # By default, hide code; set to TRUE to see code knitr::opts_chunk$set(fig.pos = 'p') # Places figures on pages separate from text
knitr::opts_chunk$set(out.width = '100%', dpi=300) # Figure resolution and size knitr::opts_chunk$set(fig.env="figure") # Latex figure environment


Introduction

This template is based on the generic OUP template available here. The original OUP sample tex document, providing more details on prefered formatting for LaTeX documents, is included with the template in the file ouparticle_sample.tex.

Here are two sample references: @Feynman1963118 [@Dirac1953888]. Bibliography will appear at the end of the document.

Materials and methods

An equation with a label for cross-referencing:

$$\label{eq:eq1} \int^{r_2}_0 F(r,\varphi){\rm d}r\,{\rm d}\varphi = [\sigma r_2/(2\mu_0)] \int^{\infty}_0\exp(-\lambda|z_j-z_i|)\lambda^{-1}J_1 (\lambda r_2)J_0 (\lambda r_i\,\lambda {\rm d}\lambda)$$

This equation can be referenced as follows: Eq. \ref{eq:eq1}

A subsection

A numbered list:

1) First point 2) Second point - Subpoint

A bullet list:

• First point
• Second point

Results

Generate a figure.

plot(1:10,main="Some data",xlab="Distance (cm)",ylab="Time (hours)")


You can reference this figure as follows: Fig. \ref{fig:fig1}.

plot(1:5,pch=19,main="Some data",xlab="Distance (cm)",ylab="Time (hours)")


Reference to second figure: Fig. \ref{fig:fig2}

Generate a table using xtable

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 the table caption",label="tab:tab1"),
comment=FALSE)


You can reference this table as follows: Table \ref{tab:tab1}.

Generate a table using kable

df = data.frame(ID=1:3,code=letters[1:3])

# kable can alse be used for creating tables
knitr::kable(df,caption="This is the table caption",format="latex",
booktabs=TRUE,label="tab2")


You can reference this table as follows: Table \ref{tab:tab2}.

Discussion

You can cross-reference sections and subsections as follows: Section \ref{materials-and-methods} and Section \ref{a-subsection}.

Note: the last section in the document will be used as the section title for the bibliography.

References

Try the rticles package in your browser

Any scripts or data that you put into this service are public.

rticles documentation built on March 4, 2021, 5:07 p.m.