# Markdown Syntax # - FORMAT : *italic*, **bold**, `code`, ~subscript~, ^superscript^, > quote, ^[footnote] # - [](hyperlink) # - EQUATION: $inline equation$, $$display equation$$, \begin{equation} (\#eq:eq-label)\end(equation), \@ref(eq:eq-label) # - CITATION: [@bib-entry1; @bib-entry2] # - FIGURE : ![](image link), knitr::include_graphics(), \@ref(fig:fig1) # - TABLE : knitr::kable(), \@ref(tab:tab1)
oldwd <- getwd() knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE) knitr::opts_knit$set(root.dir = dirname(dirname(oldwd))) require('rosr')
This template comes from the R 'rticles' package and modified by Peng Zhao. It intends to show how to cross refer other files in a 'rosr' project, rather than to show how to use the 'rticles' template.
Firstly, we switch off the codes and message display in a manuscript, and set the working directory to the rosr project.
oldwd <- getwd() knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE) knitr::opts_knit$set(root.dir = dirname(dirname(oldwd)))
Now we can use the relative path. Let's sync the bib file and run an R script.
file.copy('bib/rosr.bib', oldwd) source('R/rosr.R')
Here we cite something like this:
Many R packages have been developed recently [@R-pinyin; @R-beginr; @R-bookdownplus; @R-mindr; @R-rmd; @R-steemr].
As we just ran the source()
command, we can use the results from the R/rosr.R
. For example, the mean temperature is r temperature
degree.
We could insert a table as in Table \@ref(tab:tab-lab).
knitr::kable(head(aq), booktabs = TRUE, caption = 'Air quality data.')
Plot the data in a diagram as shown in Fig. \@ref(fig:fig-lab).
plot(aq)
We could insert an image like Fig \@ref(fig:img-lab).
fig('rosr_R.png')
Use the rosr::eq()
function to insert an equation. See Eq. \@ref(eq:sd)
eqs <- 'equation/rosr-eq.Rmd' eq(eqs, label = 'sd')
The conclusion goes here.
You can modify the section name with \conclusions[modified heading if necessary]
.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.