Skip to content

Commit

Permalink
SAGE Journals (#181)
Browse files Browse the repository at this point in the history
* rticles::smmr_article()

* improve YAML and docs

* Uncomment tests...

* Requested changes
  • Loading branch information
oguzhanogreden authored and yihui committed Jul 12, 2018
1 parent fd3ad1f commit 9782a45
Show file tree
Hide file tree
Showing 14 changed files with 3,813 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Authors@R: c(
person("Alessandro", "Gasparini", role = c("aut", "cph"), email = "ag475@leicester.ac.uk"),
person("Marc-Andre", "Desautels", role = c("aut", "cph"), email = "marc-andre.desautels@cstjean.qc.ca"),
person("Dominik", "Leutnant", role = c("aut", "cph"), email = "leutnant@fh-muenster.de"),
person(family = "MDPI", role = c("aut", "cph"))
person(family = "MDPI", role = c("aut", "cph")),
person("Oğuzhan", "Öğreden", role = c("aut"), comment = c(ORCID = "0000-0002-9949-3348"))
)
Description: A suite of custom R Markdown formats and templates for
authoring journal articles and conference submissions.
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export(pnas_article)
export(rjournal_article)
export(rsos_article)
export(rss_article)
export(sage_article)
export(sim_article)
export(springer_article)
importFrom(rmarkdown,includes_to_pandoc_args)
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
rticles 0.5
---------------------------------------------------------------------

- Added the template for the SAGE Journals (thanks, @oguzhanogreden, #181).

- Added the template for the IEEE Transaction Journals (thanks, @Emaasit, #97).

- Added the PeerJ format (thanks, @zkamvar, #127).
Expand Down
40 changes: 40 additions & 0 deletions R/sage_article.R
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)
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ The **rticles** package provides a suite of custom [R Markdown](http://rmarkdown

- [Royal Society Open Science](http://rsos.royalsocietypublishing.org/) journal submissions

- [Sage](https://uk.sagepub.com/en-gb/eur/manuscript-submission-guidelines) journal submissions

- [Springer](https://www.springer.com/gp/livingreviews/latex-templates) journal submissions

- [Statistics in Medicine](http://onlinelibrary.wiley.com/journal/10.1002/(ISSN)1097-0258/homepage/la_tex_class_file.htm) journal submissions
Expand Down
57 changes: 57 additions & 0 deletions inst/rmarkdown/templates/sage_article/resources/template.tex
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 inst/rmarkdown/templates/sage_article/skeleton/bibfile.bib
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"
}

Loading

0 comments on commit 9782a45

Please sign in to comment.