Skip to content

Commit 4630784

Browse files
arnold-ccderv
andauthored
Add Wellcome OR latex template (#436)
Co-authored-by: Christophe Dervieux <christophe.dervieux@gmail.com>
1 parent 271c8bb commit 4630784

File tree

15 files changed

+555
-5
lines changed

15 files changed

+555
-5
lines changed

DESCRIPTION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rticles
22
Type: Package
33
Title: Article Formats for R Markdown
4-
Version: 0.21.9
4+
Version: 0.21.10
55
Authors@R: c(
66
person("JJ", "Allaire", role = "aut", email = "jj@rstudio.com"),
77
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
@@ -49,7 +49,8 @@ Authors@R: c(
4949
person("Greg", "Macfarlane", role = c("ctb"), email = "gregmacfarlane@gmail.com", comment = c(github = "gregmacfarlane")),
5050
person("Matthias", "Templ", role = c("ctb"), email = "matthias.templ@gmail.com", comment = c(ORCID = "0000-0002-8638-5276", github = "matthias-da")),
5151
person("Alvaro", "Uzaheta", role = c("ctb"), email = "alvaro.uzaheta@gess.ethz.ch", comment = c(github = "auzaheta")),
52-
person("JooYoung", "Seo", role=c("ctb"), email="jseo1005@illinois.edu", comment = c(ORCID = "0000-0002-4064-6012"))
52+
person("JooYoung", "Seo", role=c("ctb"), email="jseo1005@illinois.edu", comment = c(ORCID = "0000-0002-4064-6012")),
53+
person("Callum", "Arnold", role = c("ctb"), email = "cal.rk.arnold@gmail.com", comment = c(github = "arnold-c"))
5354
)
5455
Description: A suite of custom R Markdown formats and templates for
5556
authoring journal articles and conference submissions.

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export(sim_article)
4141
export(springer_article)
4242
export(tf_article)
4343
export(trb_article)
44+
export(wellcomeor_article)
4445
importFrom(rmarkdown,includes_to_pandoc_args)
4546
importFrom(rmarkdown,knitr_options)
4647
importFrom(rmarkdown,output_format)

NEWS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
- `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).
66

7-
- Add `trb_article()` for annual meeting submissions to the Transportation Research Board Annual Meeting (thanks, @gregmacfarlane, #427).
7+
- New `trb_article()` for annual meeting submissions to the Transportation Research Board Annual Meeting (thanks, @gregmacfarlane, #427).
8+
9+
- New `wellcomeor_article()` for Wellcome Open Research articles (thanks, @arnold-c, #436).
810

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

R/article.R

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#' (e.g., `keep_tex = TRUE`).
1010
#'
1111
#' @param
12-
#' ...,keep_tex,latex_engine,citation_package,highlight,fig_caption,md_extensions,template,pandoc_args
12+
#' ...,number_sections,keep_tex,latex_engine,citation_package,highlight,fig_caption,md_extensions,template,pandoc_args
1313
#' Arguments passed to [rmarkdown::pdf_document()].
1414
#' @section Details: You can find more details about each output format below.
1515
#' @name acm_article
@@ -444,3 +444,13 @@ trb_article <- function(..., keep_tex = TRUE, citation_package = 'natbib') {
444444
"trb", keep_tex = keep_tex, citation_package = citation_package, ...
445445
)
446446
}
447+
448+
#' @section `wellcomeor_article`: Format for creating submissions to
449+
#' Wellcome Open Research. Adapted from <https://www.overleaf.com/project/6131911644b635ad3aaa4cb2>.
450+
#' @export
451+
#' @rdname article
452+
wellcomeor_article <- function(..., number_sections = FALSE, keep_tex = TRUE, citation_package = 'natbib') {
453+
pdf_document_format(
454+
"wellcomeor", keep_tex = keep_tex, number_sections = number_sections, citation_package = citation_package, ...
455+
)
456+
}

README.Rmd

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

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

README.md

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

111112
You can also get the list of available journal names with
112113
`rticles::journals()`.
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2+
%
3+
% Welcome to Overleaf --- just edit your article on the left,
4+
% and we'll compile it for you on the right. If you give
5+
% someone the link to this page, they can edit at the same
6+
% time. See the help menu above for more info. Enjoy!
7+
%
8+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9+
%
10+
% For more detailed article preparation guidelines, please see: http://wellcomeopenresearch.org/for-authors/article-guidelines and http://wellcomeopenresearch.org/for-authors/data-guidelines
11+
% Options for packages loaded elsewhere - from Pandoc's template
12+
\PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
13+
\PassOptionsToPackage{hyphens}{url}
14+
$if(colorlinks)$
15+
\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
16+
$endif$
17+
\documentclass[10pt,a4paper,twocolumn]{article}
18+
\usepackage{WellcomeOR_styles}
19+
20+
% hyperref required
21+
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
22+
23+
% Link coloring
24+
% Link coloring
25+
\hypersetup{
26+
$if(title-meta)$
27+
pdftitle={$title-meta$},
28+
$endif$
29+
$if(author-meta)$
30+
pdfauthor={$author-meta$},
31+
$endif$
32+
$if(lang)$
33+
pdflang={$lang$},
34+
$endif$
35+
$if(subject)$
36+
pdfsubject={$subject$},
37+
$endif$
38+
$if(keywords)$
39+
pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
40+
$endif$
41+
$if(colorlinks)$
42+
colorlinks=true,
43+
linkcolor={$if(linkcolor)$$linkcolor$$else$Maroon$endif$},
44+
filecolor={$if(filecolor)$$filecolor$$else$Maroon$endif$},
45+
citecolor={$if(citecolor)$$citecolor$$else$Blue$endif$},
46+
urlcolor={$if(urlcolor)$$urlcolor$$else$Blue$endif$},
47+
$else$
48+
hidelinks,
49+
$endif$
50+
pdfcreator={LaTeX via pandoc}}
51+
52+
53+
$if(natbib)$
54+
\usepackage[$if(natbiboptions)$$natbiboptions$$else$numbers$endif$]{natbib}
55+
$endif$
56+
57+
% Pandoc toggle for numbering sections
58+
$if(numbersections)$
59+
\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
60+
$else$
61+
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
62+
$endif$
63+
64+
% Pandoc syntax highlighting
65+
$if(highlighting-macros)$
66+
$highlighting-macros$
67+
$endif$
68+
69+
% tightlist command for lists without linebreak
70+
\providecommand{\tightlist}{%
71+
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
72+
73+
$if(tables)$
74+
% From pandoc table feature
75+
\usepackage{longtable,booktabs,array}
76+
$if(multirow)$
77+
\usepackage{multirow}
78+
$endif$
79+
\usepackage{calc} % for calculating minipage widths
80+
% Correct order of tables after \paragraph or \subparagraph
81+
\usepackage{etoolbox}
82+
\makeatletter
83+
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
84+
\makeatother
85+
% Allow footnotes in longtable head/foot
86+
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
87+
\makesavenoteenv{longtable}
88+
$endif$
89+
90+
% Pandoc citation processing
91+
$if(csl-refs)$
92+
\newlength{\csllabelwidth}
93+
\setlength{\csllabelwidth}{3em}
94+
\newlength{\cslhangindent}
95+
\setlength{\cslhangindent}{1.5em}
96+
% for Pandoc 2.8 to 2.10.1
97+
\newenvironment{cslreferences}%
98+
{$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
99+
\everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
100+
{\par}
101+
% For Pandoc 2.11+
102+
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
103+
{% don't indent paragraphs
104+
\setlength{\parindent}{0pt}
105+
% turn on hanging indent if param 1 is 1
106+
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
107+
% set entry spacing
108+
\ifnum #2 > 0
109+
\setlength{\parskip}{#2\baselineskip}
110+
\fi
111+
}%
112+
{}
113+
\usepackage{calc} % for calculating minipage widths
114+
\newcommand{\CSLBlock}[1]{#1\hfill\break}
115+
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
116+
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
117+
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
118+
119+
$endif$
120+
121+
$for(header-includes)$
122+
$header-includes$
123+
$endfor$
124+
125+
\begin{document}
126+
127+
\title{$title$}
128+
$if(titlenote)$
129+
\titlenote{$titlenote$}
130+
$endif$
131+
132+
$for(author)$
133+
\author[$for(author.affil)$$author.affil$$sep$,$endfor$$if(author.corresponding)$*$endif$]{$author.name$}
134+
$endfor$
135+
136+
$for(address)$
137+
\affil[$address.code$]{$address.address$}
138+
$endfor$
139+
140+
141+
\maketitle
142+
\thispagestyle{fancy}
143+
144+
$for(author)$
145+
$author.name$: $author.email$\\
146+
$endfor$
147+
* Corresponding author\\
148+
149+
$for(include-before)$
150+
$include-before$
151+
152+
$endfor$
153+
154+
\begin{abstract}
155+
$abstract$
156+
\end{abstract}
157+
158+
\section*{Keywords}
159+
$keywords$
160+
161+
\clearpage
162+
163+
$body$
164+
165+
166+
$if(natbib)$
167+
{\small\bibliographystyle{$if(biblio-style)$$biblio-style$$else$unsrtnat$endif$}
168+
$if(bibliography)$
169+
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
170+
$endif$
171+
$endif$
172+
173+
174+
% See this guide for more information on BibTeX:
175+
% http://libguides.mit.edu/content.php?pid=55482&sid=406343
176+
177+
% For more author guidance please see:
178+
% http://wellcomeopenresearch.org/for-authors/article-guidelines
179+
180+
% When all authors are happy with the paper, use the
181+
% ‘Submit to WELLCOME OPEN RESEARCH' button from the menu above
182+
% to submit directly to the open life science journal Wellcome Open Research.
183+
184+
% Please note that this template results in a draft pre-submission PDF document.
185+
% Articles will be professionally typeset when accepted for publication.
186+
187+
% We hope you find the Wellcome Open Research Overleaf template useful,
188+
% please let us know if you have any feedback using the help menu above.
189+
190+
$for(include-after)$
191+
$include-after$
192+
193+
$endfor$
194+
195+
\end{document}
Binary file not shown.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
\ProvidesPackage{WellcomeOR_styles}
2+
% Packages
3+
\usepackage{authblk}
4+
\usepackage[english]{babel}
5+
\usepackage[utf8]{inputenc}
6+
\usepackage[T1]{fontenc}
7+
\usepackage[bitstream-charter]{mathdesign}
8+
\usepackage{colortbl}
9+
\usepackage[usenames,dvipsnames,table]{xcolor}
10+
\usepackage{amsmath}
11+
\usepackage{graphicx}
12+
\usepackage{fancyhdr}
13+
\usepackage{setspace}
14+
\usepackage[labelsep=period,justification=justified]{caption}
15+
\usepackage{lastpage}
16+
\usepackage{xifthen}
17+
\usepackage{todonotes}
18+
\usepackage[hmargin=1.8cm,vmargin=2.2cm]{geometry}
19+
\usepackage[nolists,nomarkers]{endfloat}
20+
\AtBeginFigures{\rfoot{}}
21+
\AtBeginTables{\rfoot{}}
22+
23+
% Define the versionDate and flogo commands
24+
\newcommand{\versionDate}{\footnotesize Wellcome Open Research 2016 - DRAFT ARTICLE (PRE-SUBMISSION)}
25+
\newcommand{\flogo}{\includegraphics[height=12pt]{WellcomeOR_logo_black}}
26+
27+
\definecolor{WORBlue}{HTML}{009BB2}
28+
\definecolor{WORCerulean}{HTML}{60C0CE}
29+
\definecolor{WORCyan}{HTML}{BAE2E2}
30+
31+
% Section heading styles
32+
\usepackage[compact]{titlesec}
33+
34+
\titleformat*{\section}{\Large\usefont{OT1}{phv}{b}{n}\color{darkgray}}
35+
\titleformat*{\subsection}{\large\usefont{OT1}{phv}{b}{n}}
36+
\titleformat*{\subsubsection}{\large\usefont{OT1}{phv}{b}{n}}
37+
38+
% Section heading spacing (WORBlueuced space below headings)
39+
\titlespacing\section{0pt}{3.5ex plus 1.2ex minus .2ex}{0ex}
40+
\titlespacing\subsection{0pt}{3.25ex plus 1.2ex minus .2ex}{0ex}
41+
\titlespacing\subsubsection{0pt}{3.25ex plus 1.2ex minus .2ex}{0ex}
42+
43+
% Caption style
44+
\captionsetup{labelfont={color=WORBlue,bf},textfont={color=black,bf}}
45+
46+
% Table style
47+
% \definecolor{DarkKhaki}{rgb}{0.74,0.72,0.42}
48+
\colorlet{tableheadcolor}{WORCerulean} % Table header colour = 25% gray
49+
\newcommand{\header}{\rowcolor{tableheadcolor}} %
50+
\colorlet{tablerowcolor}{WORCyan} % Table row separator colour = 10% gray
51+
\newcommand{\row}{\rowcolor{tablerowcolor}} %
52+
\newenvironment{tabledata}[1][1]{%
53+
\renewcommand*{\extrarowheight}{0.1cm}%
54+
\tabular%
55+
}{%
56+
\endtabular
57+
}
58+
59+
% Define a title note command
60+
\newcommand\titlenote[1]{\renewcommand\@titlenote{#1}}
61+
\newcommand\@titlenote{}
62+
63+
% Column separation
64+
\setlength{\columnsep}{0.25in}
65+
66+
% Page margins, headers and footers
67+
\pagestyle{fancy}
68+
\setlength\parindent{0in}
69+
%\setlength\parskip{0.1in}
70+
\setlength\headheight{16.5pt}
71+
\renewcommand{\footrulewidth}{1pt}
72+
\lhead{\textsc{\flogo}}
73+
\chead{}
74+
\rhead{\versionDate}
75+
\lfoot{}
76+
\cfoot{}
77+
\rfoot{\footnotesize Page \thepage\ of \pageref{LastPage}}
78+
%
79+
\renewenvironment{abstract}{%
80+
\usefont{OT1}{phv}{m}{n}
81+
\hfill\begin{minipage}{0.65\textwidth}
82+
\rule{\textwidth}{1pt}\\ \textcolor{WORBlue}{\textbf{\abstractname}}}
83+
{\par\noindent\rule{\textwidth}{1pt}\end{minipage}}
84+
%
85+
\makeatletter
86+
\renewcommand\@maketitle{%
87+
\begin{minipage}{0.95\textwidth}
88+
\vskip 2em
89+
\let\footnote\thanks
90+
{\fontsize{20}{22}\usefont{OT1}{phv}{b}{n} \@title \par {\small{\@titlenote}} }
91+
\vskip 1.5em
92+
{\@author \par}
93+
\end{minipage}
94+
\vskip 1em \par
95+
}
96+
\makeatother
97+
\renewcommand\Authfont{\fontsize{16}{18}\usefont{OT1}{phv}{b}{n}}
98+
\renewcommand\Affilfont{\fontsize{10}{12}\usefont{OT1}{phv}{b}{n}}
Loading
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@BOOK{Smith:2012qr,
2+
title = {{B}ook {T}itle},
3+
publisher = {Publisher},
4+
author = {Smith, J.~M. and Jones, A.~B.},
5+
year = {2012},
6+
edition = {7th},
7+
}
8+
9+
@ARTICLE{Smith:2013jd,
10+
author = {Jones, A.~B. and Smith, J.~M.},
11+
title = {{A}rticle {T}itle},
12+
journal = {Journal title},
13+
year = {2013},
14+
volume = {13},
15+
pages = {123-456},
16+
number = {52},
17+
month = {March},
18+
publisher = {Publisher}
19+
}

0 commit comments

Comments
 (0)