Skip to content

Commit 10b0376

Browse files
committed
Add pandoc requirements, cls URL, missing $endfor$
1 parent 2fa19ce commit 10b0376

File tree

3 files changed

+42
-5
lines changed

3 files changed

+42
-5
lines changed

NEWS.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# rticles 0.22
2-
3-
- Add `wellcomeor_article()` template.
4-
51
# rticles 0.21
62

73
## NEW FORMATS
@@ -12,6 +8,8 @@
128

139
- New `glossa_article()` for articles of [Glossa: a journal of general linguistics](https://www.glossa-journal.org/) (thanks, @stefanocoretta, #361).
1410

11+
- New `wellcomeor_article()` for Wellcome Open Research articles
12+
1513
## MAJOR CHANGES
1614

1715
- Since **rticles** 0.15, per requirement with R Journal, `rjournal_article()` uses `knitr::purl()` to produce a R file with the code from the Rmd file. Last version eagerly overwrites any existing R file with the same name as the purled file. From now on, if a `.R` already exists with the name of the output, it won't be overwritten anymore, and not purled file will be outputted. This prevent issue with users maintaining themselves their own R file to accompany the article. A warning is issued to remind of deleting the existing R file is one want to use the purled R file (thanks, @Enchufa2, #433).

inst/rmarkdown/templates/wellcomeor/resources/template.tex

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,43 @@
2222
% \usepackage[round]{natbib}
2323
% \let\cite\citep
2424

25+
% Pandoc syntax highlighting
26+
$if(highlighting-macros)$
27+
$highlighting-macros$
28+
$endif$
29+
% Pandoc citation processing
30+
$if(csl-refs)$
31+
\newlength{\csllabelwidth}
32+
\setlength{\csllabelwidth}{3em}
33+
\newlength{\cslhangindent}
34+
\setlength{\cslhangindent}{1.5em}
35+
% for Pandoc 2.8 to 2.10.1
36+
\newenvironment{cslreferences}%
37+
{$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
38+
\everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
39+
{\par}
40+
% For Pandoc 2.11+
41+
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
42+
{% don't indent paragraphs
43+
\setlength{\parindent}{0pt}
44+
% turn on hanging indent if param 1 is 1
45+
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
46+
% set entry spacing
47+
\ifnum #2 > 0
48+
\setlength{\parskip}{#2\baselineskip}
49+
\fi
50+
}%
51+
{}
52+
\usepackage{calc} % for calculating minipage widths
53+
\newcommand{\CSLBlock}[1]{#1\hfill\break}
54+
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
55+
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
56+
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
57+
$endif$
58+
$for(header-includes)$
59+
$header-includes$
60+
$endfor$
61+
2562
\begin{document}
2663

2764
\title{$title$}
@@ -33,6 +70,7 @@
3370
$for(authors)$
3471
$authors.name$
3572
\affil{$authors.affil$}
73+
$endfor$
3674
}
3775

3876
\maketitle

inst/rmarkdown/templates/wellcomeor/skeleton/skeleton.Rmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ keywords: |
1313
1414
date: "`r Sys.Date()`"
1515
bibliography: sample.bib
16-
csl: elsevier-vancouver.csl
16+
# You can download the csl file if preferred and use it locally with `csl: elsevier-vancouver.csl`
17+
csl: https://www.zotero.org/styles/elsevier-vancouver
1718
output: rticles::wellcomeor_article
1819
---
1920

0 commit comments

Comments
 (0)