Skip to content

Commit

Permalink
add ims_article() (#372)
Browse files Browse the repository at this point in the history
Co-authored-by: Christophe Dervieux <christophe.dervieux@gmail.com>
  • Loading branch information
auzaheta and cderv authored Feb 23, 2021
1 parent 8d68165 commit 14cf24d
Show file tree
Hide file tree
Showing 16 changed files with 10,238 additions and 4 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ Authors@R: c(
person('Jay', 'Hesselberth', role = c('aut', 'ctb'), email = 'jay.hesselberth@gmail.com', comment = c(ORCID = '0000-0002-6299-179X')),
person("Alfredo", "Hernández", role = c("ctb"), email = "aldomann.designs@gmail.com", comment = c(ORCID = "0000-0002-2660-4545")),
person("Christophe", "Dervieux", role = c("aut"), email = "cderv@rstudio.com", comment = c(ORCID = "0000-0003-4474-2498")),
person("Stefano", "Coretta", role = c("ctb"), email = "stefano.coretta@gmail.com", comment = c(ORCID = "0000-0001-9627-5532", github = "stefanocoretta"))
person("Stefano", "Coretta", role = c("ctb"), email = "stefano.coretta@gmail.com", comment = c(ORCID = "0000-0001-9627-5532", github = "stefanocoretta")),
person("Alvaro", "Uzaheta", role = c("ctb"), email = "alvaro.uzaheta@gess.ethz.ch", comment = c(github = "auzaheta"))
)
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 @@ -17,6 +17,7 @@ export(ctex_article)
export(elsevier_article)
export(frontiers_article)
export(ieee_article)
export(ims_article)
export(jasa_article)
export(joss_article)
export(journals)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ rticles 0.19

- Add article template `pihph_article()` for the *Papers in Historical Phonology* (PiHPh) (thanks, @stefanocoretta, #362).

- Add article template `ims_article()` for *Institute of Mathematical Statistics* Journals, e.g., *Annals of Applied Statistics* (thanks, @auzaheta, #372)

rticles 0.18
---------------------------------------------------------------------

Expand Down
43 changes: 43 additions & 0 deletions R/article.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,49 @@ frontiers_article <- function(..., keep_tex = TRUE) {
pdf_document_format("frontiers", keep_tex = keep_tex, ...)
}

#' @param journal one of \code{"aoas"}, \code{"aap"}, \code{"aop"}, \code{"aos"}, \code{"sts"} for \code{ims_article}
#' @section \code{ims_article}: Format for creating submissions to the Institute of Mathematical Statistics
#' \href{https://imstat.org/}{IMS} journals and publications. Adapted from
#' \url{https://github.com/vtex-soft/texsupport.ims-aoas}.
#'
#' The argument \code{journal} accepts the acronym of any of the
#' \href{https://www.e-publications.org/ims/support/ims-instructions.html}{journals} in IMS:
#' \itemize{
#' \item \code{aap}: The Annals of Applied Probability
#' \item \code{aoas}: The Annals of Applied Statistics
#' \item \code{aop}: The Annals of Probability
#' \item \code{aos}: The Annals of Statistics
#' \item \code{sts}: Statistical Science}
#' @export
#' @rdname article
ims_article <- function(journal = c("aoas", "aap", "aop", "aos", "sts"),
keep_tex = TRUE, citation_package = "natbib",
md_extensions = c(
"-autolink_bare_uris" # disables automatic links
), ...) {

journal <- match.arg(journal)
if (length(journal) > 1) stop("Please choose just one ", dQuote("journal"))

with_kwsc <- journal %in% c("aap", "aop", "aos") # with keyword_subclass

args <- c(
"journal" = journal,
if (with_kwsc) c("with_kwsc" = with_kwsc)
)

# Convert to pandoc arguments
pandoc_arg_list <- mapply(rmarkdown::pandoc_variable_arg, names(args), args,
SIMPLIFY = FALSE, USE.NAMES = FALSE)
pandoc_arg_list <- unlist(pandoc_arg_list)

pdf_document_format(
"ims", keep_tex = keep_tex, citation_package = citation_package,
md_extensions = md_extensions, pandoc_args = pandoc_arg_list,
...
)
}

#' @section \code{jasa_article}: Format for creating submissions to the
#' Journal of the Acoustical Society of America. Adapted from
#' \url{https://acousticalsociety.org/preparing-latex-manuscripts/}.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Currently included templates and their contributors are the following:
| [Elsevier](https://www.elsevier.com) | [@cboettig](https://github.com/cboettig) | [#27](https://github.com/rstudio/rticles/pull/27) | `elsevier_article()` |
| [Frontiers](https://www.frontiersin.org/) | [@muschellij2](https://github.com/muschellij2) | [#211](https://github.com/rstudio/rticles/pull/211) | `frontiers_article()` |
| [IEEE Transaction](http://www.ieee.org/publications_standards/publications/authors/author_templates.html) | [@Emaasit](https://github.com/Emaasit), [@espinielli](https://github.com/espinielli), [@nathanweeks](https://github.com/nathanweeks), [@DunLug](https://github.com/DunLug) | [#97](https://github.com/rstudio/rticles/pull/97), [#169](https://github.com/rstudio/rticles/pull/169), [#227](https://github.com/rstudio/rticles/pull/227), [#263](https://github.com/rstudio/rticles/pull/263), [#264](https://github.com/rstudio/rticles/pull/264), [#265](https://github.com/rstudio/rticles/pull/265) | `ieee_article()` |
| [IMS: Institute of Mathematical Statistics](https://imstat.org/) [AoAS: Annals of Applied Statistics](https://imstat.org/journals-and-publications/annals-of-applied-statistics/) | [@auzaheta](https://github.com/auzaheta) | [#372](https://github.com/rstudio/rticles/pull/372) | `ims_article()` |
| [JASA: Journal of the Acoustical Society of America](https://asa.scitation.org/journal/jas) | [@stefanocoretta](https://github.com/stefanocoretta) | [#364](https://github.com/rstudio/rticles/pull/364) | `jasa_article()` |
| [JOSS: Journal of Open Source Software](https://joss.theoj.org/) [JOSE: Journal of Open Source Education](https://jose.theoj.org/) | [@noamross](https://github.com/noamross) | [#229](https://github.com/rstudio/rticles/pull/229) | `joss_article()` |
| [JSS: Journal of Statistical Software](https://www.jstatsoft.org) | | | `jss_article()` |
Expand Down
21 changes: 21 additions & 0 deletions inst/rmarkdown/templates/ims/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 VTeX Software

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
236 changes: 236 additions & 0 deletions inst/rmarkdown/templates/ims/resources/template.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
\documentclass[$journal$]{imsart}
%% LaTeX 2e style file for the processing of LaTeX2e files
%% of the following IMS/BS journals:
%%
%% - The Annals of Probability
%% - The Annals of Applied Probability
%% - The Annals of Statistics
%% - The Annals of Applied Statistics
%% - Statistical Science
%% - Probability Surveys
%% - Statistics Surveys
%% - Electronic Journal of Statistics
%% - Bernoulli
%% - Annales de l'Institut Henri Poincar\'e - Probabilit\'es et Statistiques
%% - Brazilian Journal of Probability and Statistics
%% - Bayesian Analysis
%%
%% - Institute of Mathematical Statistics, U.S.A.
%% - Bernoulli Society
%% - Institut Henry Poincare
%% - Brazilian Statistical Association
%% - International Society for Bayesian Analysis
%%
%% Macros written by Vytas Statulevicius, VTeX, Lithuania
%% Maintained by TeX group members, VTeX, Lithuania
%% for Institute of Mathematical Statistics, U.S.A.
%% Please submit bugs or your comments to latex-support@vtex.lt
%%
%% The original distribution is located at:
%% https://www.e-publications.org/ims/support

\RequirePackage{amsthm,amsmath,amsfonts,amssymb}
\RequirePackage[authoryear]{natbib}
\RequirePackage[colorlinks,citecolor=blue,urlcolor=blue]{hyperref}
\RequirePackage{graphicx}

% Added package
\usepackage[T1]{fontenc}
\usepackage[english]{babel}

% Pandoc syntax highlighting
$if(highlighting-macros)$
$highlighting-macros$
$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}[3] % #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}}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
$endif$


% Garantees bookdown compilation
%\usepackage{lmodern}

\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

% alternative version to the shaded problem
\makeatletter
\@ifundefined{Shaded}{
}{\renewenvironment{Shaded}{\begin{kframe}}{\end{kframe}}}
\makeatother

$if(predefined-theoremstyle)$
\startlocaldefs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%
% Uncomment next line to change %%
% the type of equation numbering %%
% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\numberwithin{equation}{section}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%
% For Axiom, Claim, Corollary, Hypothezis, %%
% Lemma, Theorem, Proposition %%
% use \theoremstyle{plain} %%
% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\theoremstyle{plain}
\newtheorem{axiom}{Axiom}
\newtheorem{claim}[axiom]{Claim}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%
% For Assumption, Definition, Example, %%
% Notation, Property, Remark, Fact %%
% use \theoremstyle{remark} %%
% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\theoremstyle{remark}
\newtheorem{definition}[theorem]{Definition}
\newtheorem*{example}{Example}
\newtheorem*{fact}{Fact}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Please put your definitions here: %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\endlocaldefs
$endif$

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

\begin{document}
\begin{frontmatter}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% Enter the title of your article here %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{$title$$if(thanks)$$for(thanks)$\thanksref{$thanks.ref$}$endfor$$endif$}
%\title{A sample article title with some additional note\thanksref{T1}}
\runtitle{$runtitle$}
%\thankstext{T1}{A sample of additional note to the title.}

$if(thanks)$
$for(thanks)$
\thankstext{$thanks.ref$}{$thanks.text$}$sep$
$endfor$
$endif$


\begin{aug}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Only one address is permitted per author. %%
%%Only division, organization and e-mail is %%
%%included in the address. %%
%%Additional information can be included in %%
%%the Acknowledgments section if necessary. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Example:
%%\author[A]{\fnms{First} \snm{Author}\ead[label=e1]{first@somewhere.com}},
%%\author[B]{\fnms{Second} \snm{Author}\ead[label=e2,mark]{second@somewhere.com}}
%%\and
%%\author[B]{\fnms{Third} \snm{Author}\ead[label=e3,mark]{third@somewhere.com}}

$for(author)$
\author[$author.addressLabel$]{\fnms{$author.name$} \snm{$author.surname$}
\ead[label=$author.label$]{$author.email$}}
$if(author.sepNext)$$author.sepNext$$endif$
$endfor$

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Addresses %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Example:
%%\address[B]{Department,
%%University or Company Name,
%%\printead{e2,e3}}
$for(affiliation)$
\address[$affiliation.label$]{$affiliation.name$,
\printead{$affiliation.authorsLabels$}}
$sep$
$endfor$
\end{aug}

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

$if(with_kwsc)$
$for(keyword-subclass)$
$keyword-subclass$
$endfor$
$endif$

\begin{keyword}
$for(keywords)$
\kwd{$keywords$}
$sep$
$endfor$
\end{keyword}

\end{frontmatter}

$if(toc)$
\tableofcontents
$endif$

$body$

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

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

$endfor$

\end{document}
30 changes: 30 additions & 0 deletions inst/rmarkdown/templates/ims/skeleton/ims.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@book{billingsley2013convergence,
title={Convergence of Probability Measures},
author={Billingsley, Patrick},
year={1999},
publisher={John Wiley \& Sons},
edition={2nd ed.}
}
@book{bourbaki1966general,
title={General Topology},
author={Bourbaki, Nicolas},
volume={1},
year={1966},
publisher={Addison--Wesley, Reading, MA.}
}
@book{ethier1985markov,
title={Markov Processes: Characterization and Convergence},
author={Ethier, Stewart N and Kurtz, Thomas G},
year={1985},
publisher={Wiley, New York}
}
@article{prokhorov1956convergence,
title={Convergence of random processes and limit theorems in probability theory},
author={Prokhorov, Yu V},
journal={Theory of Probability \& Its Applications},
volume={1},
number={2},
pages={157--214},
year={1956},
publisher={SIAM}
}
Loading

0 comments on commit 14cf24d

Please sign in to comment.