Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export(acm_article)
export(acs_article)
export(aea_article)
export(ams_article)
export(asa_article)
export(ctex)
export(ctex_template)
export(elsevier_article)
Expand Down
21 changes: 21 additions & 0 deletions R/asa_article.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#' American Statistical Association (ASA) Journal format.
#'
#' This format was adapted from The American Statistican format, but it
#' should be fairly consistent across ASA journals
#'
#' @inheritParams rmarkdown::pdf_document
#' @param ... Arguments to \code{rmarkdown::pdf_document}
#' @return R Markdown output format to pass to \code{\link[rmarkdown:render]{render}}
#' @examples
#' \dontrun{
#' rmarkdown::draft("MyArticle.Rmd", template = "asa_article", package = "rticles")
#' }
#'
#' @export
asa_article <- function(..., keep_tex = TRUE){
template <- find_resource("asa_article", "template.tex")
fmt <- inherit_pdf_document(template = template,
keep_tex = keep_tex,
citation_package = 'natbib',
...)
}
69 changes: 69 additions & 0 deletions inst/rmarkdown/templates/asa_article/resources/template.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
% !TeX program = pdfLaTeX
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{graphicx,psfrag,epsf}
\usepackage{enumerate}
\usepackage{natbib}
\usepackage{url} % not crucial - just used below for the URL

%\pdfminorversion=4
% NOTE: To produce blinded version, replace "0" with "1" below.
\newcommand{\blind}{$blinded$}

% DON'T change margins - should be 1 inch all around.
\addtolength{\oddsidemargin}{-.5in}%
\addtolength{\evensidemargin}{-.5in}%
\addtolength{\textwidth}{1in}%
\addtolength{\textheight}{1.3in}%
\addtolength{\topmargin}{-.8in}%

\begin{document}

\def\spacingset#1{\renewcommand{\baselinestretch}%
{#1}\small\normalsize} \spacingset{1}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\if0\blind
{
\title{\bf $title$}

\author{
$for(authors)$
$authors.name$ $if(authors.thanks)$\thanks{$authors.thanks$} $endif$\\
$authors.affiliation$\\
$sep$ and \\ $endfor$
}
\maketitle
} \fi

\if1\blind
{
\bigskip
\bigskip
\bigskip
\begin{center}
{\LARGE\bf $title$}
\end{center}
\medskip
} \fi

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

\noindent%
{\it Keywords:} $for(keywords)$$keywords$$sep$, $endfor$
\vfill

\newpage
\spacingset{1.45} % DON'T change the spacing!

$body$

\bibliographystyle{agsm}
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}

\end{document}
3 changes: 3 additions & 0 deletions inst/rmarkdown/templates/asa_article/skeleton/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
skeleton.tex
skeleton_files
skeleton.pdf
Loading