Skip to content

Commit

Permalink
Template for Oxford University Press (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmkaplan2000 authored Feb 4, 2020
1 parent bf8ef78 commit 0941076
Show file tree
Hide file tree
Showing 13 changed files with 1,027 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ Authors@R: c(
person("Zhian N.", "Kamvar", role = c("aut", "cph"), email = "[email protected]", comment = c(ORCID = "0000-0003-1458-7108")),
person("Noam", "Ross", role = c("aut", "cph"), email = "[email protected]", comment = c(ORCID = "0000-0002-2136-0000")),
person("Robrecht", "Cannoodt", role = c("aut", "cph"), email = "[email protected]", comment = c(ORCID = "0000-0003-3641-729X", github = "rcannood")),
person("Duncan", "Luguern", role = c("aut"), email = "[email protected]")
person("Duncan", "Luguern", role = c("aut"), email = "[email protected]"),
person("David M.", "Kaplan", role = c("aut", "ctb"), email = "[email protected]", comment = c(ORCID = "0000-0001-6087-359X", github = "dmkaplan2000"))
)
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 @@ -18,6 +18,7 @@ export(joss_article)
export(jss_article)
export(mdpi_article)
export(mnras_article)
export(oup_article)
export(peerj_article)
export(plos_article)
export(pnas_article)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ rticles 0.14

- `mnras.cls` was removed from this package because it exists on CTAN.

- Added Oxford University Press (OUP) template (thanks, @dmkaplan2000, #271).

rticles 0.13
---------------------------------------------------------------------

Expand Down
16 changes: 16 additions & 0 deletions R/article.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,22 @@ mnras_article <- function(..., keep_tex = TRUE, fig_caption = TRUE) {
)
}

#' @section \code{oup_article}: Format for creating submissions to many Oxford University Press
#' journals. Adapted from
#' \url{https://academic.oup.com/journals/pages/authors/preparing_your_manuscript}
#' and \url{https://academic.oup.com/icesjms/pages/General_Instructions}.
#' @export
#' @rdname article
oup_article <- function(
..., citation_package = 'natbib', keep_tex = TRUE,
md_extensions = c("-autolink_bare_uris")
) {
pdf_document_format(
"oup_article", citation_package = citation_package,
keep_tex = keep_tex, md_extensions = md_extensions, ...
)
}

#' @section \code{peerj_article}: Format for creating submissions to The PeerJ
#' Journal. This was adapted from the
#' \href{https://www.overleaf.com/latex/templates/latex-template-for-peerj-journal-and-pre-print-submissions/ptdwfrqxqzbn}{PeerJ
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ The **rticles** package provides a suite of custom [R Markdown](http://rmarkdown

- [NNRAS](https://www.ras.org.uk/news-and-press/2641-new-version-of-the-mnras-latex-package) journal submissions

- [OUP](https://academic.oup.com/journals/pages/authors/preparing_your_manuscript) articles

- [PeerJ](https://peerj.com) articles

- [Royal Society Open Science](http://rsos.royalsocietypublishing.org/) journal submissions
Expand Down
140 changes: 140 additions & 0 deletions inst/rmarkdown/templates/oup_article/resources/template.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
\documentclass[$if(fontsize)$$fontsize$,$else$12pt,$endif$$if(spacing)$$spacing$,$else$halfline,$endif$$if(papersize)$$papersize$,$else$a4paper,$endif$$for(classoptions)$$classoptions$$sep$,$endfor$]{ouparticle}

% Packages I think are necessary for basic Rmarkdown functionality
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{color}
\usepackage{fancyvrb}
\usepackage{framed}

%% To allow better options for figure placement
%\usepackage{float}

% Packages that are supposedly required by OUP sty file
\usepackage{amssymb, amsmath, geometry, amsfonts, verbatim, endnotes, setspace}

% For code highlighting I think
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
\definecolor{shadecolor}{RGB}{248,248,248}
\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.94,0.16,0.16}{#1}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.77,0.63,0.00}{#1}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\BuiltInTok}[1]{#1}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.64,0.00,0.00}{\textbf{#1}}}
\newcommand{\ExtensionTok}[1]{#1}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\ImportTok}[1]{#1}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
\newcommand{\NormalTok}[1]{#1}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
\newcommand{\RegionMarkerTok}[1]{#1}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}

% For making Rmarkdown lists
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}


% Part for setting citation format package: natbib
$if(natbib)$
\usepackage{natbib}
\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
$endif$

% Part for setting citation format package: biblatex
$if(biblatex)$
\usepackage[$if(biblio-citestyle)$citestyle=$biblio-citestyle$$else$citestyle=ieee$endif$$if(biblio-style)$,style=$biblio-style$$else$,style=numeric$endif$$if(citation_sorting)$,sorting=$citation_sorting$$endif$]{biblatex}
$if(bibliography)$
$for(bibliography)$
\addbibresource{$bibliography$}
$endfor$
$endif$
$endif$

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

\begin{document}

\title{$title$}

\author{%
$for(authors)$
\name{$authors.name$}$if(authors.address)$\address{$authors.address$}$endif$$if(authors.email)$\email{\href{mailto:$authors.email$}{$authors.email$}}$endif$$if(authors.thanks)$\thanks{$authors.thanks$}$else$$if(authors.corresponding_author)$\thanks{Corresponding author; Email: \href{mailto:$authors.email$}{$authors.email$}}$endif$$endif$
$sep$\and
$endfor$
}

\abstract{$abstract$}

\date{$if(date)$$date$$else$\today$endif$}

\keywords{$for(keywords)$$keywords$$sep$; $endfor$}

\maketitle


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

$body$

$if(notes)$
\begin{notes}
$notes$
\end{notes}
$endif$

$if(acknowledgements)$
\begin{notes}[Acknowledgements]
$acknowledgements$
\end{notes}
$endif$

$if(natbib)$
$if(bibliography)$

$if(biblio-title)$
$if(book-class)$
\renewcommand\bibname{$biblio-title$}
$else$
\renewcommand\refname{$biblio-title$}
$endif$
$endif$

\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
$endif$
$endif$

$if(biblatex)$
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
$endif$

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

\end{document}
20 changes: 20 additions & 0 deletions inst/rmarkdown/templates/oup_article/skeleton/mybibfile.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@article{Dirac1953888,
title = "The lorentz transformation and absolute time",
journal = "Physica ",
volume = "19",
number = "1-–12",
pages = "888--896",
year = "1953",
doi = "10.1016/S0031-8914(53)80099-6",
author = "P.A.M. Dirac"
}
@article{Feynman1963118,
title = "The theory of a general quantum system interacting with a linear dissipative system",
journal = "Annals of Physics ",
volume = "24",
pages = "118--173",
year = "1963",
doi = "10.1016/0003-4916(63)90068-X",
author = "R.P Feynman and F.L {Vernon Jr.}"
}
Loading

0 comments on commit 0941076

Please sign in to comment.