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

Added Frontiers Article #211

Merged
merged 21 commits into from
Mar 15, 2019
Merged
Show file tree
Hide file tree
Changes from 20 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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
^appveyor\.yml$
^.*\.Rproj$
^\.Rproj\.user$
^\.travis\.yml$
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Authors@R: c(
person("Dalton", "Hance", role = c("aut"), email = "dhance@usgs.gov"),
person("Daniel", "Nüst", role = c("aut", "cph"), email = "daniel.nuest@uni-muenster.de", comment = c(ORCID = "0000-0002-0024-5046")),
person("Petter", "Uvesten", role = c("aut", "cph"), email = "petter.uvesten.7362@student.lu.se"),
person("Elio", "Campitelli", role = c("aut", "cph"), email = "elio.campitelli@cima.fcen.uba.ar", comment = c(ORCID = "0000-0002-7742-9230"))
person("Elio", "Campitelli", role = c("aut", "cph"), email = "elio.campitelli@cima.fcen.uba.ar", comment = c(ORCID = "0000-0002-7742-9230")),
person("John", "Muschelli", role = c("aut", "cph"), email = "muschellij2@gmail.com", comment = c(ORCID = "0000-0001-6469-1750"))
)
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 @@ -13,6 +13,7 @@ export(copernicus_journal_abbreviations)
export(ctex)
export(ctex_template)
export(elsevier_article)
export(frontiers_article)
export(ieee_article)
export(jss_article)
export(mdpi_article)
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.7
---------------------------------------------------------------------

- Added the template for the Frontiers Journals (@muschellij2, @zkamvar, #209).

- Added the template for the AGU Journals (thanks, @eliocamp, #199).

- Updated the template for PLOS to version 3.5 (thanks, @uvesten, #196).
Expand Down
19 changes: 19 additions & 0 deletions R/frontiers_article.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#' Frontiers open access journal format.
#'
#' Format for creating Frontiers journal articles. Adapted from
#' \href{http://home.frontiersin.org/about/author-guidelines}{http://home.frontiersin.org/about/author-guidelines}.
#'
#' @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}}
#'
#' @export
frontiers_article <- function(...,
keep_tex = TRUE) {

inherit_pdf_document(...,
template = find_resource("frontiers_article", "template.tex"),
keep_tex = keep_tex)
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ The **rticles** package provides a suite of custom [R Markdown](http://rmarkdown

- [The R Journal](https://journal.r-project.org/) articles

- [Frontiers](https://www.frontiersin.org/) articles

Under the hood, LaTeX templates are used to ensure that documents conform precisely to submission standards. At the same time, composition and formatting can be done using lightweight [markdown](https://rmarkdown.rstudio.com/authoring_basics.html) syntax, and R code and its output can be seamlessly included using [knitr](https://yihui.name/knitr/).

Using **rticles** requires the prerequisites described below. You can get most of these automatically by installing the latest release of RStudio (instructions for using **rticles** without RStudio are also provided).
Expand Down
120 changes: 120 additions & 0 deletions inst/rmarkdown/templates/frontiers_article/resources/template.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is just an example/guide for you to refer to when submitting manuscripts to Frontiers, it is not mandatory to use Frontiers .cls files nor frontiers.tex %
% This will only generate the Manuscript, the final article will be typeset by Frontiers after acceptance.
% %
% %
% When submitting your files, remember to upload this *tex file, the pdf generated with it, the *bib file (if bibliography is not within the *tex) and all the figures.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% Version 3.4 Generated 2018/06/15 %%%
%%% You will need to have the following packages installed: datetime, fmtcount, etoolbox, fcprefix, which are normally inlcuded in WinEdt. %%%
%%% In http://www.ctan.org/ you can find the packages and how to install them, if necessary. %%%
%%% NB logo1.jpg is required in the path in order to correctly compile front page header %%%
muschellij2 marked this conversation as resolved.
Show resolved Hide resolved

\documentclass[utf8]{frontiersSCNS} % for Science, Engineering and Humanities and Social Sciences articles
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make it possible for users to customize the document class, you can use $documentclass$ instead of hardcoding one: http://pandoc.org/MANUAL.html#variables-for-latex

https://github.com/jgm/pandoc-templates/blob/master/default.latex#L35

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this to the options, so you can do:

output: 
  rticles::frontiers_article:
    documentclass: frontiersHLTH

%\documentclass[utf8]{frontiersHLTH} % for Health articles
%\documentclass[utf8]{frontiersFPHY} % for Physics and Applied Mathematics and Statistics articles

%\setcitestyle{square} % for Physics and Applied Mathematics and Statistics articles
\usepackage{url,hyperref,lineno,microtype,subcaption}
\usepackage[onehalfspacing]{setspace}

\linenumbers


% BELOW TAKEN FROM rticles plos template
%
% amsmath package, useful for mathematical formulas
\usepackage{amsmath}
% amssymb package, useful for mathematical symbols
\usepackage{amssymb}

% hyperref package, useful for hyperlinks
\usepackage{hyperref}

% graphicx package, useful for including eps and pdf graphics
% include graphics with the command \includegraphics
\usepackage{graphicx}

% Sweave(-like)
\usepackage{fancyvrb}
\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl}
\DefineVerbatimEnvironment{Soutput}{Verbatim}{}
\DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl}
\newenvironment{Schunk}{}{}
\DefineVerbatimEnvironment{Code}{Verbatim}{}
\DefineVerbatimEnvironment{CodeInput}{Verbatim}{fontshape=sl}
\DefineVerbatimEnvironment{CodeOutput}{Verbatim}{}
\newenvironment{CodeChunk}{}{}

% cite package, to clean up citations in the main text. Do not remove.
\usepackage{cite}

\usepackage{color}

\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

% Below is from frontiers
%
\bibliographystyle{frontiersinSCNS}
% Use doublespacing - comment out for single spacing
%\usepackage{setspace}
%\doublespacing


% Leave a blank line between paragraphs instead of using \\


\def\keyFont{\fontsize{8}{11}\helveticabold }


%% ** EDIT HERE **
%% PLEASE INCLUDE ALL MACROS BELOW

%% END MACROS SECTION

$for(header-includes)$
$header-includes$
$endfor$

$if(highlighting-macros)$
$highlighting-macros$
$endif$

\def\Authors{
$for(author)$
$author.name$\,\textsuperscript{$author.affiliation$$if(author.email)$*$endif$}$sep$,
$endfor$
}

\def\Address{
$for(affiliation)$

\textsuperscript{$affiliation.id$} $if(affiliation.department)$$affiliation.department$, $endif$$if(affiliation.institution)$$affiliation.institution$, $endif$ $if(affiliation.city)$$affiliation.city$, $endif$ $if(affiliation.state)$$affiliation.state$, $endif$ $if(affiliation.country)$$affiliation.country$$endif$
$endfor$}

$for(author)$
$if(author.email)$\def\corrAuthor{$author.name$}\def\corrAddress{$if(author.institution)$$author.institution$\\$endif$$if(author.street)$$author.street$\\$endif$$author.city$, $if(author.state)$$author.state$, $endif$$author.zip$ $if(author.country)$$author.country$$endif$}\def\corrEmail{$author.email$}$endif$
$if(author.etal)$\def\firstAuthorLast{$author.etal$ {et~al.}}$endif$
$endfor$


\begin{document}
\onecolumn
\firstpage{1}

\title[$runtitle$]{$title$}
\author[\firstAuthorLast]{\Authors}
\address{} %This field will be automatically populated
\correspondance{} %This field will be automatically populated

\extraAuth{}% If there are more than 1 corresponding author, comment this line and uncomment the next one.
%\extraAuth{corresponding Author2 \\ Laboratory X2, Institute X2, Department X2, Organization X2, Street X2, City X2 , State XX2 (only USA, Canada and Australia), Zip Code2, X2 Country X2, email2@uni2.edu}


\maketitle

$body$

\end{document}
160 changes: 160 additions & 0 deletions inst/rmarkdown/templates/frontiers_article/skeleton/frontiers.csl
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-US">
<info>
<title>Frontiers journals</title>
<id>http://www.zotero.org/styles/frontiers</id>
<link href="http://www.zotero.org/styles/frontiers" rel="self"/>
<link href="http://www.frontiersin.org/about/AuthorGuidelines" rel="documentation"/>
<author>
<name>Sebastian Karcher</name>
</author>
<contributor>
<name>Julian Onions</name>
<email>julian.onions@gmail.com</email>
</contributor>
<category citation-format="author-date"/>
<category field="generic-base"/>
<summary>Style for the Open Access Frontiers in ... Journals</summary>
<updated>2012-09-27T22:06:38+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<macro name="editor">
<names variable="editor" delimiter=", ">
<label form="short" prefix=", "/>
<name and="text" initialize-with=". " delimiter=", " prefix=" "/>
</names>
</macro>
<macro name="author">
<names variable="author">
<name name-as-sort-order="all" and="text" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/>
<label form="short" prefix=" "/>
<substitute>
<names variable="editor"/>
<text variable="title"/>
</substitute>
</names>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short" and="text" delimiter=", " initialize-with=". "/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text variable="title"/>
</substitute>
</names>
</macro>
<macro name="access">
<choose>
<if variable="DOI">
<text variable="DOI" prefix="doi:"/>
</if>
<else-if variable="URL">
<text value="Available at:" suffix=" "/>
<text variable="URL"/>
<group prefix=" [" suffix="]">
<text term="accessed" text-case="capitalize-first" suffix=" "/>
<date variable="accessed">
<date-part name="month" suffix=" "/>
<date-part name="day" suffix=", "/>
<date-part name="year"/>
</date>
</group>
</else-if>
</choose>
</macro>
<macro name="title">
<choose>
<if type="book">
<text variable="title" font-style="italic" suffix="."/>
</if>
<else-if type="chapter">
<text variable="title" quotes="true" suffix=","/>
</else-if>
<else>
<text variable="title" suffix="."/>
</else>
</choose>
</macro>
<macro name="publisher">
<group delimiter=": ">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
</macro>
<macro name="year-date">
<date variable="issued">
<date-part name="year"/>
</date>
</macro>
<macro name="edition">
<choose>
<if is-numeric="edition">
<group delimiter=" ">
<number variable="edition" form="ordinal"/>
<text term="edition" form="short"/>
</group>
</if>
<else>
<text variable="edition" suffix="."/>
</else>
</choose>
</macro>
<citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" collapse="year">
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", ">
<text macro="author-short"/>
<text macro="year-date"/>
<text variable="locator"/>
</group>
</layout>
</citation>
<bibliography hanging-indent="true" et-al-min="11" et-al-use-first="10">
<sort>
<key macro="author"/>
<key variable="title"/>
</sort>
<layout suffix=".">
<text macro="author"/>
<date variable="issued" prefix=" (" suffix=").">
<date-part name="year"/>
</date>
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<group delimiter=" " prefix=" ">
<text macro="title"/>
<text macro="edition"/>
<text macro="editor"/>
<text macro="publisher"/>
</group>
</if>
<else-if type="chapter paper-conference" match="any">
<group delimiter=" " prefix=" ">
<text macro="title"/>
<text term="in"/>
<text variable="container-title" font-style="italic"/>
<text variable="collection-title" suffix="."/>
</group>
<text macro="editor"/>
<group suffix=".">
<text macro="publisher" prefix=" (" suffix=")"/>
<group prefix=", ">
<text variable="page"/>
</group>
</group>
</else-if>
<else>
<text macro="title" prefix=" " suffix="."/>
<group delimiter=", " prefix=" " suffix=".">
<group delimiter=" ">
<text variable="container-title" form="short" font-style="italic"/>
<text variable="volume"/>
</group>
<text variable="page"/>
</group>
</else>
</choose>
<text prefix=" " macro="access"/>
</layout>
</bibliography>
</style>
Loading