Skip to content

Commit

Permalink
close #235: provide the arXiv template (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpghayes committed Aug 3, 2020
1 parent a89a1d0 commit 8757713
Show file tree
Hide file tree
Showing 13 changed files with 550 additions and 1 deletion.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Authors@R: c(
person("Petter", "Uvesten", role = c("aut", "cph"), email = "petter.uvesten.7362@student.lu.se"),
person("Elio", "Campitelli", role = c("aut", "cph"), email = "elio.campitelli@cima.fcen.uba.ar", comment = c(ORCID = "0000-0002-7742-9230")),
person("John", "Muschelli", role = c("aut", "cph"), email = "muschellij2@gmail.com", comment = c(ORCID = "0000-0001-6469-1750")),
person("Alex", "Hayes", role = "aut", email = "alexpghayes@gmail.com", comment = c(ORCID = "0000-0002-4985-5160")),
person("Zhian N.", "Kamvar", role = c("aut", "cph"), email = "zkamvar@gmail.com", comment = c(ORCID = "0000-0003-1458-7108")),
person("Noam", "Ross", role = c("aut", "cph"), email = "noam.ross@gmail.com", comment = c(ORCID = "0000-0002-2136-0000")),
person("Robrecht", "Cannoodt", role = c("aut", "cph"), email = "rcannood@gmail.com", comment = c(ORCID = "0000-0003-3641-729X", github = "rcannood")),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export(aea_article)
export(agu_article)
export(amq_article)
export(ams_article)
export(arxiv_article)
export(asa_article)
export(biometrics_article)
export(copernicus_article)
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ rticles 0.15

- Added the missing support for `header-includes` to the Biometrics template (thanks, @haozhu233, #296).

- Added support for George Kour's arXiv preprint format (thanks, @alexpghayes, #236).

rticles 0.14
---------------------------------------------------------------------

Expand Down Expand Up @@ -55,7 +57,7 @@ rticles 0.9

- Update Copernicus Publications template to version 5.3 (@nuest, #228).

- Use csl file for citations in output format `elsevier_article()` (@nuest, #233)
- Use csl file for citations in output format `elsevier_article()` (@nuest, #233).

rticles 0.8
---------------------------------------------------------------------
Expand Down
11 changes: 11 additions & 0 deletions R/article.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ asa_article <- function(..., keep_tex = TRUE, citation_package = 'natbib') {
)
}

#' @section \code{arxiv_article}: Adapted from the George Kour's format for
#' arXiv and bio-arXiv preprints. So far as I'm aware, entirely
#' unofficial but still a staple.
#' @export
#' @rdname article
arxiv_article <- function(..., keep_tex = TRUE) {
pdf_document_format(
"arxiv_article", keep_tex = keep_tex, ...
)
}

#' @section \code{biometrics_article}: This format was adapted from the
#' Biometrics journal.
#' @export
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ The **rticles** package provides a suite of custom [R Markdown](http://rmarkdown

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

- [arXiv](https://arxiv.org/) pre-prints based on George Kour's template (contributed by @alexpghayes via #236)

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

- [Bulletin de l'AMQ](https://www.amq.math.ca/bulletin/) journal submissions
Expand Down
49 changes: 49 additions & 0 deletions inst/rmarkdown/templates/arxiv_article/resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

## Description:

The project hosts an aesthetic an simple LaTeX style suitable for "preprint" publications such as arXiv and bio-arXiv, etc.
It is based on the [**nips_2018.sty**](https://media.nips.cc/Conferences/NIPS2018/Styles/nips_2018.sty) style.

This styling maintains the esthetic of NIPS but adding and changing features to make it (IMO) even better and nore suitable for preprints.
The result looks fairly different from NIPS style so that readers won't get confused to think that the preprint was published in NIPS.

### Why NIPS?
Because the NIPS styling is a comfortable single column format that is very esthetic and convenient for reading.

## Usage:
1. Use Document class **article**.
2. Copy **arxiv.sty** to the folder containing your tex file.
3. add `\usepackage{arxiv}` after `\documentclass{article}`.
4. The only packages used in the style file are **geometry** and **fancyheader**. Do not reimport them.

See **template.tex**

## Project files:
1. **arxiv.sty** - the style file.
2. **template.tex** - a sample template that uses the **arxiv style**.
3. **references.bib** - the bibliography source file for template.tex.
4. **template.pdf** - a sample output of the template file that demonstrated the design provided by the arxiv style.


## Handling References when submitting to arXiv.org
The most convenient way to manage references is using an external BibTeX file and pointing to it from the main file.
However, this requires running the [bibtex](http://www.bibtex.org/) tool to "compile" the `.bib` file and create `.bbl` file containing "bibitems" that can be directly inserted in the main tex file.
However, unfortunately the arXiv Tex environment ([Tex Live](https://www.tug.org/texlive/)) do not do that.
So easiest way when submitting to arXiv is to create a single self-contained .tex file that contains the references.
This can be done by running the BibTeX command on your machine and insert the content of the generated `.bbl` file into the `.tex` file and commenting out the `\bibliography{references}` that point to the external references file.

Below are the commands that should be run in the project folder:
1. Run `$ latex template`
2. Run `$ bibtex template`
3. A `template.bbl` file will be generated (make sure it is there)
4. Copy the `template.bbl` file content to `template.tex` into the `\begin{thebibliography}` command.
5. Comment out the `\bibliography{references}` command in `template.tex`.
6. You ready to submit to arXiv.org.


## General Notes:
1. For help, comments, praises, bug reporting or change requests, you can contact the author at: kourgeorge/at/gmail.com.
2. You can use, redistribute and do whatever with this project, however, the author takes no responsibility on whatever usage of this project.
3. If you start another project based on this project, it would be nice to mention/link to this project.
4. You are very welcome to contribute to this project.
5. A good looking 2 column template can be found in https://github.com/brenhinkeller/preprint-template.tex.
73 changes: 73 additions & 0 deletions inst/rmarkdown/templates/arxiv_article/resources/template.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
\documentclass{article}

\usepackage{arxiv}

\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc} % use 8-bit T1 fonts
\usepackage{hyperref} % hyperlinks
\usepackage{url} % simple URL typesetting
\usepackage{booktabs} % professional-quality tables
\usepackage{amsfonts} % blackboard math symbols
\usepackage{nicefrac} % compact symbols for 1/2, etc.
\usepackage{microtype} % microtypography
\usepackage{lipsum}

\title{$title$}

\author{
$for(authors)$
$authors.name$
$if(authors.thanks)$
\thanks{$authors.thanks$}
$endif$ \\
$if(authors.department)$
$authors.department$ \\
$endif$
$authors.affiliation$ \\
$authors.location$ \\
\texttt{$authors.email$} \\
$sep$ \And
$endfor$
}

$if(csl-refs)$
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newenvironment{cslreferences}%
{$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
\everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
{\par}
$endif$

\begin{document}
\maketitle

\def\tightlist{}

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

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

$if(keywords)$
\keywords{
$for(keywords)$
$keywords$
$sep$ \and
$endfor$
}
$endif$

$body$

\bibliographystyle{unsrt}
\bibliography{$bibliography$}

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

\end{document}
Loading

0 comments on commit 8757713

Please sign in to comment.