Skip to content

Commit

Permalink
Added Biometrics Template (#170)
Browse files Browse the repository at this point in the history
* Added Biometrics template

* Fiddling to make sure we've got the right LaTeX packages. Extended example text in template.

* Added some examples and changed date to pull from Sys.Date

* Added longtable

* Update DESCRIPTION

* Update NEWS

* Update NEWS

* Added biometrics_article to tests

* Updated Rd and namespace using devtools::document()

* Update README.md with Biometrics article

* Removed dependency on tikzDevice

* Added a few booktabs (for xtable compatibility) and provided command for tightlist. Changed default citation_package to natbib to match template.

* changed citation_package default to "natbib"
  • Loading branch information
daltonhance authored and yihui committed Oct 9, 2018
1 parent 54394de commit 0650a85
Show file tree
Hide file tree
Showing 14 changed files with 3,598 additions and 0 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Expand Up @@ -28,6 +28,7 @@ Authors@R: c(
person("Dominik", "Leutnant", role = c("aut", "cph"), email = "leutnant@fh-muenster.de"),
person(family = "MDPI", role = c("aut", "cph")),
person("Oğuzhan", "Öğreden", role = c("aut"), comment = c(ORCID = "0000-0002-9949-3348")),
person("Dalton", "Hance", role = c("aut"), email = "dhance@usgs.gov"),
person("Daniel", "Nüst", role = c("aut", "cph"), email = "daniel.nuest@uni-muenster.de", comment = c(ORCID = "0000-0002-0024-5046"))
)
Description: A suite of custom R Markdown formats and templates for
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Expand Up @@ -6,6 +6,7 @@ export(aea_article)
export(amq_article)
export(ams_article)
export(asa_article)
export(biometrics_article)
export(copernicus_article)
export(copernicus_journal_abbreviations)
export(ctex)
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -3,6 +3,8 @@ rticles 0.6 (unreleased)

- Added the template for the SAGE Journals (thanks, @oguzhanogreden, #181).

- Added the template for Biometrics (thanks, @daltonhance, #170).

- Added the template for Copernicus Publications journals (thanks, @nuest, #172).

- Supports syntax highlighting in the `ieee_article()` and `acm_article()` formats (thanks, @rainer-rq-koelle, #182).
Expand Down
21 changes: 21 additions & 0 deletions R/biometrics_article.R
@@ -0,0 +1,21 @@
#' Biometrics Journal format.
#'
#' This format was adapted from the Biometrics Macro package.
#'
#'
#' @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 = "biometrics_article", package = "rticles")
#' }
#'
#' @export
biometrics_article <- function(..., keep_tex = TRUE, citation_package = 'natbib'){
template <- find_resource("biometrics_article", "template.tex")
inherit_pdf_document(template = template,
keep_tex = keep_tex,
citation_package = citation_package,
...)
}
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -26,6 +26,8 @@ The **rticles** package provides a suite of custom [R Markdown](http://rmarkdown

- [AMS](https://www.ametsoc.org/) articles

- [Biometrics](http://www.biometrics.tibs.org/) articles

- [Bulletin de l'AMQ](https://www.amq.math.ca/bulletin/) journal submissions

- [CTeX](http://ctex.org) documents
Expand Down
101 changes: 101 additions & 0 deletions inst/rmarkdown/templates/biometrics_article/resources/template.tex
@@ -0,0 +1,101 @@
\documentclass[useAMS,usenatbib$if(referee)$,referee$endif$]{biom}
%\documentclass[useAMS,usenatbib,referee]{biom}
%
%
% Papers submitted to Biometrics should ALWAYS be prepared
% using the referee option!!!!
%
%
% If your system does not have the AMS fonts version 2.0 installed, then
% remove the useAMS option.
%
% useAMS allows you to obtain upright Greek characters.
% e.g. \umu, \upi etc. See the section on "Upright Greek characters" in
% this guide for further information.
%
% If you are using AMS 2.0 fonts, bold math letters/symbols are available
% at a larger range of sizes for NFSS release 1 and 2 (using \boldmath or
% preferably \bmath).
%
% The usenatbib command allows the use of Patrick Daly's natbib package for
% cross-referencing.
%
% If you wish to typeset the paper in Times font (if you do not have the
% PostScript Type 1 Computer Modern fonts you will need to do this to get
% smoother fonts in a PDF file) then uncomment the next line
% \usepackage{Times}
%%%%% AUTHORS - PLACE YOUR OWN MACROS HERE %%%%%

\usepackage[figuresright]{rotating}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage[hyphens]{url} % not crucial - just used below for the URL
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{booktabs}
%% \raggedbottom % To avoid glue in typesetteing, sbs>>

$if(highlighting-macros)$
$highlighting-macros$
$endif$

% tightlist command for lists without linebreak
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setcounter{footnote}{2}

\title[$header$]{$title$}

\author{$for(author)$ $author.name$ \email{$author.email$} \\ $author.affiliation$ $sep$ \and
$endfor$
}

\begin{document}

\date{{\it Received $month$} $year$}

\pagerange{\pageref{firstpage}--\pageref{lastpage}} \pubyear{$year$}

\volume{0}
\artmonth{January}
\doi{0000-0000-0000}

% This label and the label ``lastpage'' are used by the \pagerange
% command above to give the page range for the article

\label{firstpage}

% pub the summary here

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

%
% Please place your key words in alphabetical order, separated
% by semicolons, with the first letter of the first word capitalized,
% and a period at the end of the list.
%

\begin{keywords}
$keywords$.
\end{keywords}

\maketitle

$body$

$if(natbib)$

\bibliographystyle{biom}
\bibliography{$bibliography$}

$endif$

\label{lastpage}

\end{document}
@@ -0,0 +1,66 @@
%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/
%% Created for Sachs, Michael (NIH/NCI) [E] at 2014-10-27 13:53:44 -0400
%% Saved with string encoding Unicode (UTF-8)
@book{pepe2003statistical,
Author = {Pepe, Margaret Sullivan},
Date-Added = {2014-10-27 17:28:41 +0000},
Date-Modified = {2014-10-27 17:53:38 +0000},
Publisher = {Oxford University Press},
Title = {The statistical evaluation of medical tests for classification and prediction},
Year = {2003}}

@article{hoerl1970ridge,
Author = {Hoerl, Arthur E and Kennard, Robert W},
Date-Added = {2014-10-27 17:28:25 +0000},
Date-Modified = {2014-10-27 17:28:25 +0000},
Journal = {Technometrics},
Number = {1},
Pages = {55--67},
Publisher = {Taylor \& Francis Group},
Title = {Ridge regression: Biased estimation for nonorthogonal problems},
Volume = {12},
Year = {1970}}

@article{zou2005regularization,
Author = {Zou, Hui and Hastie, Trevor},
Date-Added = {2014-10-27 17:28:23 +0000},
Date-Modified = {2014-10-27 17:28:23 +0000},
Journal = {Journal of the Royal Statistical Society: Series B (Statistical Methodology)},
Number = {2},
Pages = {301--320},
Publisher = {Blackwell Publishing Ltd},
Title = {Regularization and variable selection via the elastic net},
Volume = {67},
Year = {2005}}

@article{schoenfeld1982partial,
Author = {Schoenfeld, David},
Date-Added = {2014-10-27 17:28:09 +0000},
Date-Modified = {2014-10-27 17:28:09 +0000},
Journal = {Biometrika},
Number = {1},
Pages = {239--241},
Publisher = {Oxford University Press},
Title = {Partial residuals for the proportional hazards regression model},
Volume = {69},
Year = {1982}}

@article{heagerty2000time,
Author = {Heagerty, Patrick J and Lumley, Thomas and Pepe, Margaret S},
Date-Added = {2014-10-27 17:28:02 +0000},
Date-Modified = {2014-10-27 17:28:02 +0000},
Journal = {Biometrics},
Number = {2},
Pages = {337--344},
Publisher = {Blackwell Publishing Ltd},
Title = {Time-dependent ROC curves for censored survival data and a diagnostic marker},
Volume = {56},
Year = {2000}}

0 comments on commit 0650a85

Please sign in to comment.