Skip to content

Commit

Permalink
fix #260: add the cslreferences environment to all LaTeX templates
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Dec 6, 2019
1 parent 1c5dfcd commit ee529ad
Show file tree
Hide file tree
Showing 29 changed files with 251 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rticles
Type: Package
Title: Article Formats for R Markdown
Version: 0.12.2
Version: 0.12.3
Authors@R: c(
person("JJ", "Allaire", role = "aut", email = "[email protected]"),
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
rticles 0.13
---------------------------------------------------------------------

- Added the `cslreferences` environment to all templates (thanks, @bbauzile, #260).

- Updated the template for `elsevier_article()` to allow for two authors to share the same footnote (e.g. "these authors made equal contributions") and updated the corresponding skeleton to demonstrate how to use a shared footnote (thanks, @salauer, #255).

rticles 0.12
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/acm_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@
$highlighting-macros$
$endif$

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
10 changes: 10 additions & 0 deletions inst/rmarkdown/templates/acs_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@
% avoid problems with \sout in headers with hyperref:
\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
$endif$

$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$

% pandoc header
$for(header-includes)$
$header-includes$
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/aea_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@

\usepackage{hyperref}

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/agu_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@

\journalname{$journal$}

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/amq_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,15 @@

\everymath{\displaystyle}

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
10 changes: 10 additions & 0 deletions inst/rmarkdown/templates/ams_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@
$exauthors.email$
$endif$
$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$

% pandoc header
$for(header-includes)$
$header-includes$
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/asa_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
$highlighting-macros$
$endif$

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@
$highlighting-macros$
$endif$

$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$

% tightlist command for lists without linebreak
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@
%\usepackage{subfig}
%\usepackage{rotating}

$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$

% The "Technical instructions for LaTex" by Copernicus require _not_ to insert any additional packages.
%$for(header-includes)$
%$header-includes$
Expand Down
10 changes: 10 additions & 0 deletions inst/rmarkdown/templates/ctex/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@
\author{$for(author)$$author$$sep$ \and $endfor$}
$endif$
\date{$date$}

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
10 changes: 10 additions & 0 deletions inst/rmarkdown/templates/elsevier_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@
$else$
\setcounter{secnumdepth}{0}
$endif$

$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$

% Pandoc header
$for(header-includes)$
$header-includes$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@

%% END MACROS SECTION

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/ieee_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,15 @@
$highlighting-macros$
$endif$

$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$

% Pandoc header
$for(header-includes)$
$header-includes$
Expand Down
10 changes: 10 additions & 0 deletions inst/rmarkdown/templates/joss_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,16 @@
\newenvironment{LTR}{\beginL}{\endL}
\fi
$endif$

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/jss_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@
$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$

% Pandoc header
$for(header-includes)$
$header-includes$
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/mdpi_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@
%\setcounter{secnumdepth}{4}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/mnras_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@
% Please keep new commands to a minimum, and use \newcommand not \def to avoid
% overwriting existing commands. Example:

$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$

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

%%%%%%%%%%%%%%%%%%% TITLE PAGE %%%%%%%%%%%%%%%%%%%
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/peerj_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@
$highlighting-macros$
$endif$

$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$

% Pandoc Header
$for(header-includes)$
$header-includes$
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/plos_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,15 @@
$highlighting-macros$
$endif$

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/pnas_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
\usepackage{longtable}
$endif$

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
}
$endif$

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/rsos_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
9 changes: 9 additions & 0 deletions inst/rmarkdown/templates/rss_article/resources/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
\usepackage[authoryear]{natbib}
\bibpunct{(}{)}{;}{a}{}{,}

$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$

$for(header-includes)$
$header-includes$
$endfor$
Expand Down
Loading

0 comments on commit ee529ad

Please sign in to comment.