Skip to content

Commit 320d850

Browse files
authored
Add highlighting-macros to all templates (#435)
1 parent e553097 commit 320d850

File tree

15 files changed

+98
-3
lines changed

15 files changed

+98
-3
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# rticles 0.21
22

3+
- All templates have now the `$highlighting-macros$` variables required for Pandoc highlighting (#435).
4+
35
- Template for `tf_article()` gains a `classoption` variable (thanks, @statzhero, #434).
46

57
- Add the fenced div with id `#refs` in `frontiers_article()` skeleton to place the reference section in the correct expected place (thanks, @graysonwhite, #423).

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
6161
$endif$
6262

63+
% For Pandoc highlighting needs
64+
$if(highlighting-macros)$
65+
$highlighting-macros$
66+
$endif$
67+
6368
% Pandoc citation processing
6469
$if(csl-refs)$
6570
\newlength{\csllabelwidth}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
% with 1.5 corresponding to "double" spacing.
2424
\draftSpacing{1.5}
2525

26+
% For Pandoc highlighting needs
27+
$if(highlighting-macros)$
28+
$highlighting-macros$
29+
$endif$
30+
2631
% Pandoc citation processing
2732
$if(csl-refs)$
2833
\newlength{\csllabelwidth}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@
6464

6565
\journalname{$journal$}
6666

67+
% For Pandoc highlighting needs
68+
$if(highlighting-macros)$
69+
$highlighting-macros$
70+
$endif$
71+
6772
% Pandoc citation processing
6873
$if(csl-refs)$
6974
\newlength{\csllabelwidth}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@
237237

238238
\everymath{\displaystyle}
239239

240+
% For Pandoc highlighting needs
241+
$if(highlighting-macros)$
242+
$highlighting-macros$
243+
$endif$
244+
240245
% Pandoc citation processing
241246
$if(csl-refs)$
242247
\newlength{\csllabelwidth}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@
6464
$endif$
6565
$endfor$
6666

67+
% For Pandoc highlighting needs
68+
$if(highlighting-macros)$
69+
$highlighting-macros$
70+
$endif$
71+
6772
% Pandoc citation processing
6873
$if(csl-refs)$
6974
\newlength{\csllabelwidth}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
\usepackage{longtable}
1010
$endif$
1111

12+
% For Pandoc highlighting needs
13+
$if(highlighting-macros)$
14+
$highlighting-macros$
15+
$endif$
16+
1217
% Pandoc citation processing
1318
$if(csl-refs)$
1419
\newlength{\csllabelwidth}

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,41 @@
7070
\hideLIPIcs
7171
$endif$
7272

73+
% For Pandoc highlighting needs
74+
$if(highlighting-macros)$
75+
$highlighting-macros$
76+
$endif$
77+
78+
% Pandoc citation processing
79+
$if(csl-refs)$
80+
\newlength{\csllabelwidth}
81+
\setlength{\csllabelwidth}{3em}
82+
\newlength{\cslhangindent}
83+
\setlength{\cslhangindent}{1.5em}
84+
% for Pandoc 2.8 to 2.10.1
85+
\newenvironment{cslreferences}%
86+
{$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
87+
\everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
88+
{\par}
89+
% For Pandoc 2.11+
90+
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
91+
{% don't indent paragraphs
92+
\setlength{\parindent}{0pt}
93+
% turn on hanging indent if param 1 is 1
94+
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
95+
% set entry spacing
96+
\ifnum #2 > 0
97+
\setlength{\parskip}{#2\baselineskip}
98+
\fi
99+
}%
100+
{}
101+
\usepackage{calc} % for calculating minipage widths
102+
\newcommand{\CSLBlock}[1]{#1\hfill\break}
103+
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
104+
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
105+
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
106+
$endif$
107+
73108
%header-includes to be used sparingly
74109
$for(header-includes)$
75110
$header-includes$

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353
% Please keep new commands to a minimum, and use \newcommand not \def to avoid
5454
% overwriting existing commands. Example:
5555

56+
% For Pandoc highlighting needs
57+
$if(highlighting-macros)$
58+
$highlighting-macros$
59+
$endif$
60+
5661
% Pandoc citation processing
5762
$if(csl-refs)$
5863
\newlength{\csllabelwidth}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
\usepackage{longtable}
1616
$endif$
1717

18+
% For Pandoc highlighting needs
19+
$if(highlighting-macros)$
20+
$highlighting-macros$
21+
$endif$
22+
1823
% Pandoc citation processing
1924
$if(csl-refs)$
2025
\newlength{\csllabelwidth}

0 commit comments

Comments
 (0)