Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAGE Journals #181

Merged
merged 4 commits into from
Jul 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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