This template and example include:
- Common order for scientific papers (i.e., main text, references, tables and figures).
- Page breaks for both word and pdf documents
- Table and figure captions for main text and supporting information.
r page_break()
will add page break for word and pdf documents. r page_break("Figures")
will add page break and a new page starts with section "Figures".
References:
# rendering to PDF
render("main_text.rmd", "bookdown::pdf_document2")
# rendering to docx
render("main_text.rmd", "bookdown::word_document2")
library(methods)
library(knitr)
library(kableExtra)
library(png)
library(grid)
library(pander)
source("rmd_func.r")
Title: Title of your manuscript
First Author^1,2^ Second Author^2^, and Third Author^3^
^1^ First Affiliation
^2^ Second Affiliation
^3^ Third Affiliation
r page_break("Abstract")
Your abstract.
Your introduction [@Wright2004a]. Some more text [@Kraft2008]. More text [@Hubbell2001].
Your Material and Methods. We fitted XXXX:
\begin{equation} N_{ij} \sim NB(\mu_{ij}, \phi) (#eq:NB) \end{equation}
where
\begin{equation} \mu_{ij} \times v_i = exp(\Sigma \beta_{jk} z_{ik}) (#eq:mu) \end{equation}
where
We found XXX (Fig. @ref(fig:scatplt) and Table @ref(tab:tblm)). We also found xxx (Fig. @ref(fig:boxplt)) yay!
Some texts.
r page_break()
Table: (#tab:tblm). Summary of the regression model.
fit <- lm(mpg ~ wt * cyl, data = mtcars)
tb1 <- pander(fit, caption = "")
tb1
r page_break()
tb2 <- head(mtcars)
kable(tb2, caption = "Some datasets.")
r page_break("Figures")
img <- readPNG("scat.png", native = TRUE, info = TRUE)
grid.raster(img, interpolate=F)
r page_break()
img <- readPNG("boxp.png", native = TRUE, info = TRUE)
grid.raster(img, interpolate=F)
knitr::kable(mtcars)
r page_break()
grid.raster(img, interpolate=F)