Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Springer Journal Article template #164

Merged
merged 4 commits into from
Apr 16, 2018
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 @@ -19,6 +19,7 @@ export(rjournal_article)
export(rsos_article)
export(rss_article)
export(sim_article)
export(springer_article)
importFrom(rmarkdown,includes_to_pandoc_args)
importFrom(rmarkdown,knitr_options)
importFrom(rmarkdown,output_format)
Expand Down
21 changes: 21 additions & 0 deletions R/springer_article.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#' Springer Journal format.
#'
#' This format was adapted from the Springer Macro package for Springer
#' 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 = "springer_article", package = "rticles")
#' }
#'
#' @export
springer_article <- function(..., keep_tex = TRUE, citation_package = 'none'){
template <- find_resource("springer_article", "template.tex")
inherit_pdf_document(template = template,
keep_tex = keep_tex,
citation_package = citation_package,
...)
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ The **rticles** package provides a suite of custom [R Markdown](http://rmarkdown

- [MDPI](http://www.mdpi.com) journal submissions

- [Springer](https://www.springer.com/gp/livingreviews/latex-templates) journal submissions

Under the hood, LaTeX templates are used to ensure that documents conform precisely to submission standards. At the same time, composition and formatting can be done using lightweight [markdown](http://rmarkdown.rstudio.com/authoring_basics.html) syntax, and R code and its output can be seamlessly included using [knitr](http://yihui.name/knitr/).

Using **rticles** requires the prerequisites described below. You can get most of these automatically by installing the latest release of RStudio (instructions for using **rticles** without RStudio are also provided).
Expand Down
5 changes: 5 additions & 0 deletions inst/rmarkdown/templates/asa_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@
%% load any required packages here
$preamble$

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next time it will be better if you could separate this into a different pull request since it is not related to the new Springer format (i.e. one thing per PR).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right! (Didn't know it's not related.)

\begin{document}


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

Expand Down
103 changes: 103 additions & 0 deletions inst/rmarkdown/templates/springer_article/resources/template.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
% !TeX program = pdfLaTeX
\documentclass[smallextended]{svjour3} % onecolumn (second format)
%\documentclass[twocolumn]{svjour3} % twocolumn
%
\smartqed % flush right qed marks, e.g. at end of proof
%
\usepackage{amsmath}
\usepackage{graphicx}

\usepackage[hyphens]{url} % not crucial - just used below for the URL
\usepackage{hyperref}
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

%
% \usepackage{mathptmx} % use Times fonts if available on your TeX system
%
% insert here the call for the packages your document requires
%\usepackage{latexsym}
% etc.
%
% please place your own definitions here and don't use \def but
% \newcommand{}{}
%
% Insert the name of "your journal" with
% \journalname{myjournal}
%

%% load any required packages here
$preamble$

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

\begin{document}

\title{$title$ $if(thanks)$\thanks{$thanks$} $endif$}
$if(subtitle)$ \subtitle{$subtitle$} $endif$

$if(titlerunning)$
\titlerunning{$titlerunning$}
$endif$

\author{ $for(authors)$ $authors.name$ \and $endfor$ }

$if(authorrunning)$
\authorrunning{ $authorrunning$ }
$endif$

\institute{
$for(authors)$
$authors.name$ \at
$if(authors.address)$ $authors.address$ $endif$\\
$if(authors.email)$ \email{$authors.email$} $endif$ % \\
% \emph{Present address:} of F. Author % if needed
\and
$endfor$
}

\date{Received: date / Accepted: date}
% The correct dates will be entered by the editor


\maketitle

\begin{abstract}
$abstract$
\\
\keywords{
$for(keywords)$
$keywords$ \and
$endfor$
}
$if(PACS)$
\PACS{
$for(PACS)$
$PACS$ \and
$endfor$
}
$endif$

$if(MSC)$
\subclass{
$for(MSC)$
$MSC$ \and
$endfor$
}
$endif$

\end{abstract}


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


$body$

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

\end{document}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
%% Copied from asa_article template


@incollection{Galyardt14mmm,
Author = {April Galyardt},
Booktitle = {Handbook of Mixed Membership Models},
Date-Added = {2014-08-21 21:18:27 +0000},
Date-Modified = {2014-08-21 21:18:27 +0000},
Editor = {Edoardo M. Airoldi and David Blei and Erosheva, Elena and Fienberg, Stephen E.},
Publisher = {Chapman and Hall},
Title = {Interpreting Mixed Membership Models: Implications of Erosheva's Representation Theorem},
Year = {2014}
}


@incollection{Mislevy06Cog,
Author = {Robert Mislevy},
Booktitle = {Educational Assessment},
Chapter = {8},
Date-Added = {2014-08-21 20:58:59 +0000},
Date-Modified = {2014-08-21 20:58:59 +0000},
Editor = {Robert L. Brennan},
Publisher = {American Council on Education and Praeger Publishers},
Title = {Cognitive Psychology and Educational Assessment},
Year = {2006}
}
65 changes: 65 additions & 0 deletions inst/rmarkdown/templates/springer_article/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: Title here
subtitle: Do you have a subtitle? If so, write it here
titlerunning: Short form of title (if too long for head)
authorrunning: Short form of author list if too long for running head
thanks: |
Grants or other notes about the article that should go on the front
page should be placed here. General acknowledgments should be placed at the
end of the article.

authors:
- name: Author 1
address: Department of YYY, University of XXX
email: abc@def

- name: Author 2
address: Department of ZZZ, University of WWW
email: djf@wef

keywords:
- key
- dictionary
- word

#PACS:
#- PAC1
#- superPAC

MSC:
- MSC code 1
- MSC code 2

abstract: |
The text of your abstract. 150 -- 250 words.

bibliography: bibliography.bib
output: rticles::springer_article
---

# Introduction {#intro}

Your text comes here. Separate text sections with

# Section title {#sec:1}

Text with citations by @Galyardt14mmm, [@Mislevy06Cog].

## Subsection title {#sec:2}

as required. Don't forget to give each section
and subsection a unique label (see Sect. \ref{sec:1}).

#### Paragraph headings

Use paragraph headings as needed.

\begin{align}
a^2+b^2=c^2
\end{align}





# References
Loading