Skip to content

Commit 14cf24d

Browse files
auzahetacderv
andauthored
add ims_article() (#372)
Co-authored-by: Christophe Dervieux <christophe.dervieux@gmail.com>
1 parent 8d68165 commit 14cf24d

File tree

16 files changed

+10238
-4
lines changed

16 files changed

+10238
-4
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ Authors@R: c(
4545
person('Jay', 'Hesselberth', role = c('aut', 'ctb'), email = 'jay.hesselberth@gmail.com', comment = c(ORCID = '0000-0002-6299-179X')),
4646
person("Alfredo", "Hernández", role = c("ctb"), email = "aldomann.designs@gmail.com", comment = c(ORCID = "0000-0002-2660-4545")),
4747
person("Christophe", "Dervieux", role = c("aut"), email = "cderv@rstudio.com", comment = c(ORCID = "0000-0003-4474-2498")),
48-
person("Stefano", "Coretta", role = c("ctb"), email = "stefano.coretta@gmail.com", comment = c(ORCID = "0000-0001-9627-5532", github = "stefanocoretta"))
48+
person("Stefano", "Coretta", role = c("ctb"), email = "stefano.coretta@gmail.com", comment = c(ORCID = "0000-0001-9627-5532", github = "stefanocoretta")),
49+
person("Alvaro", "Uzaheta", role = c("ctb"), email = "alvaro.uzaheta@gess.ethz.ch", comment = c(github = "auzaheta"))
4950
)
5051
Description: A suite of custom R Markdown formats and templates for
5152
authoring journal articles and conference submissions.

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export(ctex_article)
1717
export(elsevier_article)
1818
export(frontiers_article)
1919
export(ieee_article)
20+
export(ims_article)
2021
export(jasa_article)
2122
export(joss_article)
2223
export(journals)

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ rticles 0.19
44

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

7+
- Add article template `ims_article()` for *Institute of Mathematical Statistics* Journals, e.g., *Annals of Applied Statistics* (thanks, @auzaheta, #372)
8+
79
rticles 0.18
810
---------------------------------------------------------------------
911

R/article.R

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,49 @@ frontiers_article <- function(..., keep_tex = TRUE) {
175175
pdf_document_format("frontiers", keep_tex = keep_tex, ...)
176176
}
177177

178+
#' @param journal one of \code{"aoas"}, \code{"aap"}, \code{"aop"}, \code{"aos"}, \code{"sts"} for \code{ims_article}
179+
#' @section \code{ims_article}: Format for creating submissions to the Institute of Mathematical Statistics
180+
#' \href{https://imstat.org/}{IMS} journals and publications. Adapted from
181+
#' \url{https://github.com/vtex-soft/texsupport.ims-aoas}.
182+
#'
183+
#' The argument \code{journal} accepts the acronym of any of the
184+
#' \href{https://www.e-publications.org/ims/support/ims-instructions.html}{journals} in IMS:
185+
#' \itemize{
186+
#' \item \code{aap}: The Annals of Applied Probability
187+
#' \item \code{aoas}: The Annals of Applied Statistics
188+
#' \item \code{aop}: The Annals of Probability
189+
#' \item \code{aos}: The Annals of Statistics
190+
#' \item \code{sts}: Statistical Science}
191+
#' @export
192+
#' @rdname article
193+
ims_article <- function(journal = c("aoas", "aap", "aop", "aos", "sts"),
194+
keep_tex = TRUE, citation_package = "natbib",
195+
md_extensions = c(
196+
"-autolink_bare_uris" # disables automatic links
197+
), ...) {
198+
199+
journal <- match.arg(journal)
200+
if (length(journal) > 1) stop("Please choose just one ", dQuote("journal"))
201+
202+
with_kwsc <- journal %in% c("aap", "aop", "aos") # with keyword_subclass
203+
204+
args <- c(
205+
"journal" = journal,
206+
if (with_kwsc) c("with_kwsc" = with_kwsc)
207+
)
208+
209+
# Convert to pandoc arguments
210+
pandoc_arg_list <- mapply(rmarkdown::pandoc_variable_arg, names(args), args,
211+
SIMPLIFY = FALSE, USE.NAMES = FALSE)
212+
pandoc_arg_list <- unlist(pandoc_arg_list)
213+
214+
pdf_document_format(
215+
"ims", keep_tex = keep_tex, citation_package = citation_package,
216+
md_extensions = md_extensions, pandoc_args = pandoc_arg_list,
217+
...
218+
)
219+
}
220+
178221
#' @section \code{jasa_article}: Format for creating submissions to the
179222
#' Journal of the Acoustical Society of America. Adapted from
180223
#' \url{https://acousticalsociety.org/preparing-latex-manuscripts/}.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Currently included templates and their contributors are the following:
4141
| [Elsevier](https://www.elsevier.com) | [@cboettig](https://github.com/cboettig) | [#27](https://github.com/rstudio/rticles/pull/27) | `elsevier_article()` |
4242
| [Frontiers](https://www.frontiersin.org/) | [@muschellij2](https://github.com/muschellij2) | [#211](https://github.com/rstudio/rticles/pull/211) | `frontiers_article()` |
4343
| [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()` |
44+
| [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()` |
4445
| [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()` |
4546
| [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()` |
4647
| [JSS: Journal of Statistical Software](https://www.jstatsoft.org) | | | `jss_article()` |
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 VTeX Software
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
\documentclass[$journal$]{imsart}
2+
%% LaTeX 2e style file for the processing of LaTeX2e files
3+
%% of the following IMS/BS journals:
4+
%%
5+
%% - The Annals of Probability
6+
%% - The Annals of Applied Probability
7+
%% - The Annals of Statistics
8+
%% - The Annals of Applied Statistics
9+
%% - Statistical Science
10+
%% - Probability Surveys
11+
%% - Statistics Surveys
12+
%% - Electronic Journal of Statistics
13+
%% - Bernoulli
14+
%% - Annales de l'Institut Henri Poincar\'e - Probabilit\'es et Statistiques
15+
%% - Brazilian Journal of Probability and Statistics
16+
%% - Bayesian Analysis
17+
%%
18+
%% - Institute of Mathematical Statistics, U.S.A.
19+
%% - Bernoulli Society
20+
%% - Institut Henry Poincare
21+
%% - Brazilian Statistical Association
22+
%% - International Society for Bayesian Analysis
23+
%%
24+
%% Macros written by Vytas Statulevicius, VTeX, Lithuania
25+
%% Maintained by TeX group members, VTeX, Lithuania
26+
%% for Institute of Mathematical Statistics, U.S.A.
27+
%% Please submit bugs or your comments to latex-support@vtex.lt
28+
%%
29+
%% The original distribution is located at:
30+
%% https://www.e-publications.org/ims/support
31+
32+
\RequirePackage{amsthm,amsmath,amsfonts,amssymb}
33+
\RequirePackage[authoryear]{natbib}
34+
\RequirePackage[colorlinks,citecolor=blue,urlcolor=blue]{hyperref}
35+
\RequirePackage{graphicx}
36+
37+
% Added package
38+
\usepackage[T1]{fontenc}
39+
\usepackage[english]{babel}
40+
41+
% Pandoc syntax highlighting
42+
$if(highlighting-macros)$
43+
$highlighting-macros$
44+
$endif$
45+
46+
% Pandoc citation processing
47+
$if(csl-refs)$
48+
\newlength{\csllabelwidth}
49+
\setlength{\csllabelwidth}{3em}
50+
\newlength{\cslhangindent}
51+
\setlength{\cslhangindent}{1.5em}
52+
% for Pandoc 2.8 to 2.10.1
53+
\newenvironment{cslreferences}%
54+
{$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
55+
\everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
56+
{\par}
57+
% For Pandoc 2.11+
58+
\newenvironment{CSLReferences}[3] % #1 hanging-ident, #2 entry spacing
59+
{% don't indent paragraphs
60+
\setlength{\parindent}{0pt}
61+
% turn on hanging indent if param 1 is 1
62+
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
63+
% set entry spacing
64+
\ifnum #2 > 0
65+
\setlength{\parskip}{#2\baselineskip}
66+
\fi
67+
}%
68+
{}
69+
\usepackage{calc} % for calculating minipage widths
70+
\newcommand{\CSLBlock}[1]{#1\hfill\break}
71+
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
72+
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}}
73+
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
74+
$endif$
75+
76+
77+
% Garantees bookdown compilation
78+
%\usepackage{lmodern}
79+
80+
\makeatletter
81+
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
82+
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
83+
\makeatother
84+
% Scale images if necessary, so that they will not overflow the page
85+
% margins by default, and it is still possible to overwrite the defaults
86+
% using explicit options in \includegraphics[width, height, ...]{}
87+
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
88+
% Set default figure placement to htbp
89+
\makeatletter
90+
\def\fps@figure{htbp}
91+
\makeatother
92+
\setlength{\emergencystretch}{3em} % prevent overfull lines
93+
\providecommand{\tightlist}{%
94+
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
95+
96+
% alternative version to the shaded problem
97+
\makeatletter
98+
\@ifundefined{Shaded}{
99+
}{\renewenvironment{Shaded}{\begin{kframe}}{\end{kframe}}}
100+
\makeatother
101+
102+
$if(predefined-theoremstyle)$
103+
\startlocaldefs
104+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105+
% %%
106+
% Uncomment next line to change %%
107+
% the type of equation numbering %%
108+
% %%
109+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
110+
\numberwithin{equation}{section}
111+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
112+
% %%
113+
% For Axiom, Claim, Corollary, Hypothezis, %%
114+
% Lemma, Theorem, Proposition %%
115+
% use \theoremstyle{plain} %%
116+
% %%
117+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
118+
\theoremstyle{plain}
119+
\newtheorem{axiom}{Axiom}
120+
\newtheorem{claim}[axiom]{Claim}
121+
\newtheorem{theorem}{Theorem}[section]
122+
\newtheorem{lemma}[theorem]{Lemma}
123+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
124+
% %%
125+
% For Assumption, Definition, Example, %%
126+
% Notation, Property, Remark, Fact %%
127+
% use \theoremstyle{remark} %%
128+
% %%
129+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
130+
\theoremstyle{remark}
131+
\newtheorem{definition}[theorem]{Definition}
132+
\newtheorem*{example}{Example}
133+
\newtheorem*{fact}{Fact}
134+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
135+
% Please put your definitions here: %%
136+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
137+
\endlocaldefs
138+
$endif$
139+
140+
% pandoc header
141+
$for(header-includes)$
142+
$header-includes$
143+
$endfor$
144+
145+
\begin{document}
146+
\begin{frontmatter}
147+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
148+
%% %%
149+
%% Enter the title of your article here %%
150+
%% %%
151+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
152+
\title{$title$$if(thanks)$$for(thanks)$\thanksref{$thanks.ref$}$endfor$$endif$}
153+
%\title{A sample article title with some additional note\thanksref{T1}}
154+
\runtitle{$runtitle$}
155+
%\thankstext{T1}{A sample of additional note to the title.}
156+
157+
$if(thanks)$
158+
$for(thanks)$
159+
\thankstext{$thanks.ref$}{$thanks.text$}$sep$
160+
$endfor$
161+
$endif$
162+
163+
164+
\begin{aug}
165+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
166+
%%Only one address is permitted per author. %%
167+
%%Only division, organization and e-mail is %%
168+
%%included in the address. %%
169+
%%Additional information can be included in %%
170+
%%the Acknowledgments section if necessary. %%
171+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
172+
173+
%% Example:
174+
%%\author[A]{\fnms{First} \snm{Author}\ead[label=e1]{first@somewhere.com}},
175+
%%\author[B]{\fnms{Second} \snm{Author}\ead[label=e2,mark]{second@somewhere.com}}
176+
%%\and
177+
%%\author[B]{\fnms{Third} \snm{Author}\ead[label=e3,mark]{third@somewhere.com}}
178+
179+
$for(author)$
180+
\author[$author.addressLabel$]{\fnms{$author.name$} \snm{$author.surname$}
181+
\ead[label=$author.label$]{$author.email$}}
182+
$if(author.sepNext)$$author.sepNext$$endif$
183+
$endfor$
184+
185+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
186+
%% Addresses %%
187+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
188+
%% Example:
189+
%%\address[B]{Department,
190+
%%University or Company Name,
191+
%%\printead{e2,e3}}
192+
$for(affiliation)$
193+
\address[$affiliation.label$]{$affiliation.name$,
194+
\printead{$affiliation.authorsLabels$}}
195+
$sep$
196+
$endfor$
197+
\end{aug}
198+
199+
\begin{abstract}
200+
$abstract$
201+
\end{abstract}
202+
203+
$if(with_kwsc)$
204+
$for(keyword-subclass)$
205+
$keyword-subclass$
206+
$endfor$
207+
$endif$
208+
209+
\begin{keyword}
210+
$for(keywords)$
211+
\kwd{$keywords$}
212+
$sep$
213+
$endfor$
214+
\end{keyword}
215+
216+
\end{frontmatter}
217+
218+
$if(toc)$
219+
\tableofcontents
220+
$endif$
221+
222+
$body$
223+
224+
$if(bibliography)$
225+
$if(biblio-style)$
226+
\bibliographystyle{$biblio-style$}
227+
$endif$
228+
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
229+
$endif$
230+
231+
$for(include-after)$
232+
$include-after$
233+
234+
$endfor$
235+
236+
\end{document}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@book{billingsley2013convergence,
2+
title={Convergence of Probability Measures},
3+
author={Billingsley, Patrick},
4+
year={1999},
5+
publisher={John Wiley \& Sons},
6+
edition={2nd ed.}
7+
}
8+
@book{bourbaki1966general,
9+
title={General Topology},
10+
author={Bourbaki, Nicolas},
11+
volume={1},
12+
year={1966},
13+
publisher={Addison--Wesley, Reading, MA.}
14+
}
15+
@book{ethier1985markov,
16+
title={Markov Processes: Characterization and Convergence},
17+
author={Ethier, Stewart N and Kurtz, Thomas G},
18+
year={1985},
19+
publisher={Wiley, New York}
20+
}
21+
@article{prokhorov1956convergence,
22+
title={Convergence of random processes and limit theorems in probability theory},
23+
author={Prokhorov, Yu V},
24+
journal={Theory of Probability \& Its Applications},
25+
volume={1},
26+
number={2},
27+
pages={157--214},
28+
year={1956},
29+
publisher={SIAM}
30+
}

0 commit comments

Comments
 (0)