-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rticles::smmr_article() * improve YAML and docs * Uncomment tests... * Requested changes
- Loading branch information
1 parent
fd3ad1f
commit 9782a45
Showing
14 changed files
with
3,813 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#' Sage Journals format. | ||
#' | ||
#' Format for creating submissions to Sage Journals. Based on the official Sage Journals | ||
#' \href{https://uk.sagepub.com/sites/default/files/sage_latex_template_4.zip}{class}. | ||
#' | ||
#' @inheritParams rmarkdown::pdf_document | ||
#' @param ... Additional arguments to \code{rmarkdown::pdf_document} | ||
#' | ||
#' @return R Markdown output format to pass to | ||
#' \code{\link[rmarkdown:render]{render}} | ||
#' | ||
#' @details Possible arguments for the YAML header are: | ||
#' \itemize{ | ||
#' \item \code{title} title of the manuscript | ||
#' \item \code{runninghead} short author list for header | ||
#' \item \code{author} list of authors, containing \code{name} and \code{num} | ||
#' \item \code{address} list containing \code{num} and \code{org} for defining \code{author} affiliations | ||
#' \item \code{corrauth} corresponding author name and address | ||
#' \item \code{email} correspondence email | ||
#' \item \code{abstract} abstract, limited to 200 words | ||
#' \item \code{keywords} keywords for the artucle | ||
#' \item \code{bibliography} BibTeX \code{.bib} file name | ||
#' \item \code{classoption} options of the \code{sagej} class | ||
#' \item \code{header-includes}: custom additions to the header, before the \code{\\begin\{document\}} statement | ||
#' \item \code{include-after}: for including additional LaTeX code before the \code{\\end\{document\}} statement} | ||
#' | ||
#' @examples | ||
#' | ||
#' \dontrun{ | ||
#' library(rmarkdown) | ||
#' draft("MyArticle.Rmd", template = "sage_article", package = "rticles") | ||
#' } | ||
#' | ||
#' @export | ||
sage_article <- function(..., highlight = NULL, citation_package = "natbib") { | ||
inherit_pdf_document(..., | ||
template = find_resource("sage_article", "template.tex"), | ||
highlight = highlight, | ||
citation_package = citation_package) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
inst/rmarkdown/templates/sage_article/resources/template.tex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
\documentclass[$for(classoption)$$classoption$$sep$,$endfor$,$bibliographystyle$]{sagej} | ||
|
||
\usepackage{moreverb,url,natbib, multirow, tabularx} | ||
\usepackage[colorlinks,bookmarksopen,bookmarksnumbered,citecolor=red,urlcolor=red]{hyperref} | ||
|
||
$if(longtable)$ | ||
\usepackage{longtable} | ||
$endif$ | ||
|
||
$for(header-includes)$ | ||
$header-includes$ | ||
$endfor$ | ||
|
||
|
||
\begin{document} | ||
|
||
\title{$title$} | ||
|
||
\runninghead{$runninghead$} | ||
|
||
\author{$for(author)$$author.name$\affilnum{$author.num$}$sep$, $endfor$} | ||
|
||
\affiliation{$for(address)$\affilnum{$address.num$}{$address.org$}$sep$\\$endfor$} | ||
|
||
$if(corrauth)$ | ||
\corrauth{$corrauth$} | ||
$endif$ | ||
|
||
$if(email)$ | ||
\email{$email$} | ||
$endif$ | ||
|
||
$if(abstract)$ | ||
\begin{abstract} | ||
$abstract$ | ||
\end{abstract} | ||
$endif$ | ||
|
||
$if(keywords)$ | ||
\keywords{$keywords$} | ||
$endif$ | ||
|
||
\maketitle | ||
|
||
$body$ | ||
|
||
$if(bibliography)$ | ||
\bibliographystyle{$bibliographystyle$} | ||
\bibliography{$bibliography$} | ||
$endif$ | ||
|
||
$for(include-after)$ | ||
$include-after$ | ||
|
||
$endfor$ | ||
|
||
\end{document} |
27 changes: 27 additions & 0 deletions
27
inst/rmarkdown/templates/sage_article/skeleton/bibfile.bib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@article{Knupp1999, | ||
author = "Knupp, PM", | ||
title = "Winslow smoothing on two-dimensional unstructured meshes", | ||
year = "1999", | ||
journal = "Eng {C}omput", | ||
volume = "15", | ||
pages = "263--268" | ||
} | ||
|
||
@techreport{kamm2000, | ||
author = "Kamm, J", | ||
title = "Evaluation of the {S}edov-von {N}eumann-{T}aylor blast wave solution", | ||
institution = "Los {A}lamos {N}ational {L}aboratory", | ||
year = "2000", | ||
number = "Technical {R}eport LA-UR-00-6055" | ||
} | ||
|
||
@article{Taylor1937, | ||
author = "Taylor, GI and Green, AE", | ||
title = "Mechanism of the production of small eddies from large ones", | ||
year = "1937", | ||
journal = "P {R}oy {S}oc {L}ond {A} {M}at", | ||
volume = "158", | ||
number = "895", | ||
pages = "499--521" | ||
} | ||
|
Oops, something went wrong.