Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
766dbc7
Squash previous WellcomeOR commits to remove unwanted arXiv files
arnold-c Sep 20, 2021
0249ad2
Merge remote-tracking branch 'rstudio/master' into wellcome-open-res
arnold-c Sep 20, 2021
060e90c
Add comma to DESCRIPTION
arnold-c Sep 20, 2021
4f51fb7
Add missing Pandoc list requirement and hyperref package to template
arnold-c Sep 21, 2021
b77fea0
Remove extraneous detail from template.yaml
arnold-c Sep 21, 2021
538c45d
Update citations to allow for correct formatting of RMarkdown citations
arnold-c Sep 21, 2021
37421b9
Update skeleton.Rmd to use Bookdown referencing system
arnold-c Sep 21, 2021
6e8a48e
Update template for section numbering, author afilliations, and links
arnold-c Sep 21, 2021
2be1390
Merge branch 'master' into arnold-c-wellcome-open-res
cderv Nov 26, 2021
692b816
Update WellcomeOR hyperref setup to correctly color links
arnold-c Dec 8, 2021
d2a84ae
Allow WellcomeOR to change bib styles & update ref sec of skeleton
arnold-c Dec 8, 2021
e1fd1dd
Update inst/rmarkdown/templates/wellcomeor/skeleton/skeleton.Rmd
arnold-c Dec 8, 2021
faa2f5c
Add `$include-before$` to WellcomeOR
arnold-c Dec 8, 2021
1ec1bf5
Remove elsevier vancouver csl from WellcomeOR
arnold-c Dec 8, 2021
218ab89
Update inst/rmarkdown/templates/wellcomeor/template.yaml
arnold-c Dec 8, 2021
36fdf8a
Add `include-after` to WellcomeOR
arnold-c Dec 8, 2021
4bb1beb
Set WellcomeOR to always remove section numbering
arnold-c Dec 8, 2021
db4800b
WellcomeOR multiple author affiliations
arnold-c Dec 8, 2021
a0e5205
Add corresponding author and author emails to WellcomeOR template
arnold-c Dec 9, 2021
c69c812
Merge commit '080207e644bc7a1d4f6738ce2c2068beb7907575'
cderv Dec 9, 2021
e51d39b
Missing line to remove from merge commit
cderv Dec 9, 2021
3a53681
Add missing tables part for Pandoc
cderv Dec 9, 2021
4c3e81c
Update R/article.R
arnold-c Dec 9, 2021
d78ac83
Update NEWS.md
arnold-c Dec 9, 2021
f133984
Update R/article.R
arnold-c Dec 9, 2021
ba198ef
Update inst/rmarkdown/templates/wellcomeor/resources/template.tex
arnold-c Dec 9, 2021
bb5607b
Update inst/rmarkdown/templates/wellcomeor/resources/template.tex
arnold-c Dec 9, 2021
ccf8324
Update inst/rmarkdown/templates/wellcomeor/resources/template.tex
arnold-c Dec 9, 2021
f827901
Update inst/rmarkdown/templates/wellcomeor/skeleton/skeleton.Rmd
arnold-c Dec 9, 2021
d75fd4a
Update inst/rmarkdown/templates/wellcomeor/skeleton/skeleton.Rmd
arnold-c Dec 9, 2021
dc10956
Update inst/rmarkdown/templates/wellcomeor/resources/template.tex
arnold-c Dec 9, 2021
36313cd
Update inst/rmarkdown/templates/wellcomeor/resources/template.tex
arnold-c Dec 9, 2021
2edc851
Update inst/rmarkdown/templates/wellcomeor/skeleton/skeleton.Rmd
arnold-c Dec 9, 2021
d600ae7
Update R/article.R
arnold-c Dec 9, 2021
18e034a
Update inst/rmarkdown/templates/wellcomeor/resources/template.tex
arnold-c Dec 9, 2021
83c4433
Update inst/rmarkdown/templates/wellcomeor/resources/template.tex
arnold-c Dec 9, 2021
89e518c
Build documentation
cderv Dec 10, 2021
3c4ac51
Merged upstream/master into arnold-c-wellcome-open-res
cderv Dec 10, 2021
080c257
wellcomeor is the first to use number_sections as argument
cderv Dec 10, 2021
278ea85
Bump version
cderv Dec 10, 2021
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
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rticles
Type: Package
Title: Article Formats for R Markdown
Version: 0.21.9
Version: 0.21.10
Authors@R: c(
person("JJ", "Allaire", role = "aut", email = "jj@rstudio.com"),
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
Expand Down Expand Up @@ -49,7 +49,8 @@ Authors@R: c(
person("Greg", "Macfarlane", role = c("ctb"), email = "gregmacfarlane@gmail.com", comment = c(github = "gregmacfarlane")),
person("Matthias", "Templ", role = c("ctb"), email = "matthias.templ@gmail.com", comment = c(ORCID = "0000-0002-8638-5276", github = "matthias-da")),
person("Alvaro", "Uzaheta", role = c("ctb"), email = "alvaro.uzaheta@gess.ethz.ch", comment = c(github = "auzaheta")),
person("JooYoung", "Seo", role=c("ctb"), email="jseo1005@illinois.edu", comment = c(ORCID = "0000-0002-4064-6012"))
person("JooYoung", "Seo", role=c("ctb"), email="jseo1005@illinois.edu", comment = c(ORCID = "0000-0002-4064-6012")),
person("Callum", "Arnold", role = c("ctb"), email = "cal.rk.arnold@gmail.com", comment = c(github = "arnold-c"))
)
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 @@ -41,6 +41,7 @@ export(sim_article)
export(springer_article)
export(tf_article)
export(trb_article)
export(wellcomeor_article)
importFrom(rmarkdown,includes_to_pandoc_args)
importFrom(rmarkdown,knitr_options)
importFrom(rmarkdown,output_format)
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

- `sage_article()` now correctly set cite style in template to use comma to match the Sage Havard style per Journal's guideline (thanks, @MalteHueckstaedt, #447).

- Add `trb_article()` for annual meeting submissions to the Transportation Research Board Annual Meeting (thanks, @gregmacfarlane, #427).
- New `trb_article()` for annual meeting submissions to the Transportation Research Board Annual Meeting (thanks, @gregmacfarlane, #427).

- New `wellcomeor_article()` for Wellcome Open Research articles (thanks, @arnold-c, #436).

- Add `copyrightyear` and `pubyear` variable in `bioinformatics_article()` (thanks, @stephenturner, #424).

Expand Down
12 changes: 11 additions & 1 deletion R/article.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' (e.g., `keep_tex = TRUE`).
#'
#' @param
#' ...,keep_tex,latex_engine,citation_package,highlight,fig_caption,md_extensions,template,pandoc_args
#' ...,number_sections,keep_tex,latex_engine,citation_package,highlight,fig_caption,md_extensions,template,pandoc_args
#' Arguments passed to [rmarkdown::pdf_document()].
#' @section Details: You can find more details about each output format below.
#' @name acm_article
Expand Down Expand Up @@ -444,3 +444,13 @@ trb_article <- function(..., keep_tex = TRUE, citation_package = 'natbib') {
"trb", keep_tex = keep_tex, citation_package = citation_package, ...
)
}

#' @section `wellcomeor_article`: Format for creating submissions to
#' Wellcome Open Research. Adapted from <https://www.overleaf.com/project/6131911644b635ad3aaa4cb2>.
#' @export
#' @rdname article
wellcomeor_article <- function(..., number_sections = FALSE, keep_tex = TRUE, citation_package = 'natbib') {
pdf_document_format(
"wellcomeor", keep_tex = keep_tex, number_sections = number_sections, citation_package = citation_package, ...
)
}
1 change: 1 addition & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Currently included templates and their contributors are the following:
| [Taylor & Francis](https://www.tandfonline.com/)| [\@dleutnant](https://github.com/dleutnant)| [\#218](https://github.com/rstudio/rticles/pull/218) | `tf_article()` |
| [The R Journal](https://journal.r-project.org/) ||| `rjournal_article()` |
| [TRB](https://trb.secure-platform.com/a/page/TRBPaperReview) | [@gregmacfarlane](https://github.com/gregmacfarlane) | [#427](https://github.com/rstudio/rticles/pull/427) | `trb_article()` |
| [Wellcome Open Research](https://wellcomeopenresearch.org) | [\@arnold-c](https://github.com/arnold-c) | [#436](https://github.com/rstudio/rticles/pull/436) | `wellcomeor_article()`|

You can also get the list of available journal names with `rticles::journals()`.

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Currently included templates and their contributors are the following:
| [Taylor & Francis](https://www.tandfonline.com/) | [@dleutnant](https://github.com/dleutnant) | [#218](https://github.com/rstudio/rticles/pull/218) | `tf_article()` |
| [The R Journal](https://journal.r-project.org/) | | | `rjournal_article()` |
| [TRB](https://trb.secure-platform.com/a/page/TRBPaperReview) | [@gregmacfarlane](https://github.com/gregmacfarlane) | [#427](https://github.com/rstudio/rticles/pull/427) | `trb_article()` |
| [Wellcome Open Research](https://wellcomeopenresearch.org) | [@arnold-c](https://github.com/arnold-c) | [#436](https://github.com/rstudio/rticles/pull/436) | `wellcomeor_article()` |

You can also get the list of available journal names with
`rticles::journals()`.
Expand Down
195 changes: 195 additions & 0 deletions inst/rmarkdown/templates/wellcomeor/resources/template.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Welcome to Overleaf --- just edit your article on the left,
% and we'll compile it for you on the right. If you give
% someone the link to this page, they can edit at the same
% time. See the help menu above for more info. Enjoy!
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% For more detailed article preparation guidelines, please see: http://wellcomeopenresearch.org/for-authors/article-guidelines and http://wellcomeopenresearch.org/for-authors/data-guidelines
% Options for packages loaded elsewhere - from Pandoc's template
\PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
\PassOptionsToPackage{hyphens}{url}
$if(colorlinks)$
\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
$endif$
\documentclass[10pt,a4paper,twocolumn]{article}
\usepackage{WellcomeOR_styles}

% hyperref required
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}

% Link coloring
% Link coloring
\hypersetup{
$if(title-meta)$
pdftitle={$title-meta$},
$endif$
$if(author-meta)$
pdfauthor={$author-meta$},
$endif$
$if(lang)$
pdflang={$lang$},
$endif$
$if(subject)$
pdfsubject={$subject$},
$endif$
$if(keywords)$
pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
$endif$
$if(colorlinks)$
colorlinks=true,
linkcolor={$if(linkcolor)$$linkcolor$$else$Maroon$endif$},
filecolor={$if(filecolor)$$filecolor$$else$Maroon$endif$},
citecolor={$if(citecolor)$$citecolor$$else$Blue$endif$},
urlcolor={$if(urlcolor)$$urlcolor$$else$Blue$endif$},
$else$
hidelinks,
$endif$
pdfcreator={LaTeX via pandoc}}


$if(natbib)$
\usepackage[$if(natbiboptions)$$natbiboptions$$else$numbers$endif$]{natbib}
$endif$

% Pandoc toggle for numbering sections
$if(numbersections)$
\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
$else$
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
$endif$

% Pandoc syntax highlighting
$if(highlighting-macros)$
$highlighting-macros$
$endif$

% tightlist command for lists without linebreak
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

$if(tables)$
% From pandoc table feature
\usepackage{longtable,booktabs,array}
$if(multirow)$
\usepackage{multirow}
$endif$
\usepackage{calc} % for calculating minipage widths
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
$endif$

% Pandoc citation processing
$if(csl-refs)$
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
% for Pandoc 2.8 to 2.10.1
\newenvironment{cslreferences}%
{$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
\everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
{\par}
% For Pandoc 2.11+
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
{% don't indent paragraphs
\setlength{\parindent}{0pt}
% turn on hanging indent if param 1 is 1
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
% set entry spacing
\ifnum #2 > 0
\setlength{\parskip}{#2\baselineskip}
\fi
}%
{}
\usepackage{calc} % for calculating minipage widths
\newcommand{\CSLBlock}[1]{#1\hfill\break}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}

$endif$

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

\begin{document}

\title{$title$}
$if(titlenote)$
\titlenote{$titlenote$}
$endif$

$for(author)$
\author[$for(author.affil)$$author.affil$$sep$,$endfor$$if(author.corresponding)$*$endif$]{$author.name$}
$endfor$

$for(address)$
\affil[$address.code$]{$address.address$}
$endfor$


\maketitle
\thispagestyle{fancy}

$for(author)$
$author.name$: $author.email$\\
$endfor$
* Corresponding author\\

$for(include-before)$
$include-before$

$endfor$

\begin{abstract}
$abstract$
\end{abstract}

\section*{Keywords}
$keywords$

\clearpage

$body$


$if(natbib)$
{\small\bibliographystyle{$if(biblio-style)$$biblio-style$$else$unsrtnat$endif$}
$if(bibliography)$
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
$endif$
$endif$


% See this guide for more information on BibTeX:
% http://libguides.mit.edu/content.php?pid=55482&sid=406343

% For more author guidance please see:
% http://wellcomeopenresearch.org/for-authors/article-guidelines

% When all authors are happy with the paper, use the
% ‘Submit to WELLCOME OPEN RESEARCH' button from the menu above
% to submit directly to the open life science journal Wellcome Open Research.

% Please note that this template results in a draft pre-submission PDF document.
% Articles will be professionally typeset when accepted for publication.

% We hope you find the Wellcome Open Research Overleaf template useful,
% please let us know if you have any feedback using the help menu above.

$for(include-after)$
$include-after$

$endfor$

\end{document}
Binary file not shown.
98 changes: 98 additions & 0 deletions inst/rmarkdown/templates/wellcomeor/skeleton/WellcomeOR_styles.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
\ProvidesPackage{WellcomeOR_styles}
% Packages
\usepackage{authblk}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[bitstream-charter]{mathdesign}
\usepackage{colortbl}
\usepackage[usenames,dvipsnames,table]{xcolor}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage[labelsep=period,justification=justified]{caption}
\usepackage{lastpage}
\usepackage{xifthen}
\usepackage{todonotes}
\usepackage[hmargin=1.8cm,vmargin=2.2cm]{geometry}
\usepackage[nolists,nomarkers]{endfloat}
\AtBeginFigures{\rfoot{}}
\AtBeginTables{\rfoot{}}

% Define the versionDate and flogo commands
\newcommand{\versionDate}{\footnotesize Wellcome Open Research 2016 - DRAFT ARTICLE (PRE-SUBMISSION)}
\newcommand{\flogo}{\includegraphics[height=12pt]{WellcomeOR_logo_black}}

\definecolor{WORBlue}{HTML}{009BB2}
\definecolor{WORCerulean}{HTML}{60C0CE}
\definecolor{WORCyan}{HTML}{BAE2E2}

% Section heading styles
\usepackage[compact]{titlesec}

\titleformat*{\section}{\Large\usefont{OT1}{phv}{b}{n}\color{darkgray}}
\titleformat*{\subsection}{\large\usefont{OT1}{phv}{b}{n}}
\titleformat*{\subsubsection}{\large\usefont{OT1}{phv}{b}{n}}

% Section heading spacing (WORBlueuced space below headings)
\titlespacing\section{0pt}{3.5ex plus 1.2ex minus .2ex}{0ex}
\titlespacing\subsection{0pt}{3.25ex plus 1.2ex minus .2ex}{0ex}
\titlespacing\subsubsection{0pt}{3.25ex plus 1.2ex minus .2ex}{0ex}

% Caption style
\captionsetup{labelfont={color=WORBlue,bf},textfont={color=black,bf}}

% Table style
% \definecolor{DarkKhaki}{rgb}{0.74,0.72,0.42}
\colorlet{tableheadcolor}{WORCerulean} % Table header colour = 25% gray
\newcommand{\header}{\rowcolor{tableheadcolor}} %
\colorlet{tablerowcolor}{WORCyan} % Table row separator colour = 10% gray
\newcommand{\row}{\rowcolor{tablerowcolor}} %
\newenvironment{tabledata}[1][1]{%
\renewcommand*{\extrarowheight}{0.1cm}%
\tabular%
}{%
\endtabular
}

% Define a title note command
\newcommand\titlenote[1]{\renewcommand\@titlenote{#1}}
\newcommand\@titlenote{}

% Column separation
\setlength{\columnsep}{0.25in}

% Page margins, headers and footers
\pagestyle{fancy}
\setlength\parindent{0in}
%\setlength\parskip{0.1in}
\setlength\headheight{16.5pt}
\renewcommand{\footrulewidth}{1pt}
\lhead{\textsc{\flogo}}
\chead{}
\rhead{\versionDate}
\lfoot{}
\cfoot{}
\rfoot{\footnotesize Page \thepage\ of \pageref{LastPage}}
%
\renewenvironment{abstract}{%
\usefont{OT1}{phv}{m}{n}
\hfill\begin{minipage}{0.65\textwidth}
\rule{\textwidth}{1pt}\\ \textcolor{WORBlue}{\textbf{\abstractname}}}
{\par\noindent\rule{\textwidth}{1pt}\end{minipage}}
%
\makeatletter
\renewcommand\@maketitle{%
\begin{minipage}{0.95\textwidth}
\vskip 2em
\let\footnote\thanks
{\fontsize{20}{22}\usefont{OT1}{phv}{b}{n} \@title \par {\small{\@titlenote}} }
\vskip 1.5em
{\@author \par}
\end{minipage}
\vskip 1em \par
}
\makeatother
\renewcommand\Authfont{\fontsize{16}{18}\usefont{OT1}{phv}{b}{n}}
\renewcommand\Affilfont{\fontsize{10}{12}\usefont{OT1}{phv}{b}{n}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions inst/rmarkdown/templates/wellcomeor/skeleton/sample.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@BOOK{Smith:2012qr,
title = {{B}ook {T}itle},
publisher = {Publisher},
author = {Smith, J.~M. and Jones, A.~B.},
year = {2012},
edition = {7th},
}

@ARTICLE{Smith:2013jd,
author = {Jones, A.~B. and Smith, J.~M.},
title = {{A}rticle {T}itle},
journal = {Journal title},
year = {2013},
volume = {13},
pages = {123-456},
number = {52},
month = {March},
publisher = {Publisher}
}
Loading