YAML header:
output: rticles::sim_article: keep_tex: TRUE
Configure the YAML header including the following elements:
title
: Title
runninghead
: Author last names, use et al. if there are three or more authors.
author
: List of author(s) containing name
and num
corrauth
: Corresponding author's name and address.
email
: Correspondence email
abstract
: Limited to 200 words
keywords
: Keywords for the article
bibliography
: BibTeX .bib
file
bibliographystyle
: sageh or sagev
classoption
: options of the sagej
class
bibliographystyle
classoption
Keywords are separated by commas.
Use mathematics in Rmarkdown as usual.
Figures are supported from R code:
```r", out.width='100%'} x = rnorm(10) y = rnorm(10) plot(x, y)
...and can be referenced (Figure \ref{fig:plot}) by including the `\\label{}` tag in the `fig.cap` attribute of the R chunk: `fig.cap = "Fancy Caption\\label{fig:plot}"`. It is a quirky hack at the moment, see [here](https://github.com/yihui/knitr/issues/323). Analogously, use Rmarkdown to produce tables as usual: ```r if (!require("xtable")) install.packages("xtable") xt <- xtable(head(cars), caption = "A table", label = "tab:table") print(xt, comment = FALSE)
Referenced via \ref{tab:table}. You can also use the YAML option header-includes
to includes custom \LaTeX packages for tables (keep in mind that pandoc
uses longtables
by default, and it is hardcoded; some things may require including the package longtable
). E.g., using ctable
:
header-includes: - \usepackage{ctable}
Then, just write straight-up \LaTeX code and reference is as usual (\ref{tab:ctable}
):
\ctable[cap = {Short caption}, caption = {A caption for this table.}, label={tab:ctable},] {cc} { \tnote[$\ast$]{Footnote 1} \tnote[$\dagger$]{Other footnote} \tnote[b]{Mistakes are possible.} }{ \FL COL 1\tmark[a] & COL 2\tmark[$\ast$] \ML 6.92\tmark[$\dagger$] & 0.09781 \\ 6.93\tmark[$\dagger$] & 0.09901 \\ 97 & 2000 \LL }
It is also possible to set the YAML
option longtable: true
and use markdown tables (or the knitr::kable
function): knitr::kable(head(cars))
produces the same table as the xtable
example presented before.
The use of the Rmarkdown equivalent of the \LaTeX cross-reference system
for figures, tables, equations, etc., is encouraged (using [@<name>]
, equivalent of \ref{<name>}
and \label{<name>}
). That works well for citations in Rmarkdown, not so well for figures and tables. In that case, it is possible to revert to standard \LaTeX syntax.
If you need to double space your document for submission please use the doublespace
option in the header.
Link a .bib
document via the YAML header, and bibliography will be printed at the very end (as usual). The default bibliography style is provided by Wiley as in WileyNJD-AMA.bst
, do not delete that file.
Use the Rmarkdown equivalent of the \LaTeX citation system using [@<name>]
. Example: [@Taylor1937], [@Knupp1999; @Kamm2000].
To include all citation from the .bib
file, add \nocite{*}
before the end of the document.
All \LaTeX enviroments supported by the main template are supported here as well; see the .tex
sample file here for more details and example.
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.