From 04743ea497b4adc99749b473159588cbb8ab7a90 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 2 May 2023 12:04:44 +0200 Subject: [PATCH] Correctly support verbatim-in-notes in template that already supports it Based on Pandoc template change https://github.com/jgm/pandoc/commit/c9cf8568bfda40cc8027a2eb6b7f87ba296fbd23 --- inst/rmarkdown/templates/asa/resources/template.tex | 7 ++++++- inst/rmarkdown/templates/elsevier/resources/template.tex | 1 + inst/rmarkdown/templates/glossa/resources/template.tex | 6 +++++- inst/rmarkdown/templates/jasa/resources/template.tex | 6 +++++- inst/rmarkdown/templates/joss/resources/template.tex | 6 +++++- inst/rmarkdown/templates/oup_v1/resources/template.tex | 4 ++++ inst/rmarkdown/templates/pihph/resources/template.tex | 6 +++++- 7 files changed, 31 insertions(+), 5 deletions(-) diff --git a/inst/rmarkdown/templates/asa/resources/template.tex b/inst/rmarkdown/templates/asa/resources/template.tex index 332f6a269..0c607f93a 100644 --- a/inst/rmarkdown/templates/asa/resources/template.tex +++ b/inst/rmarkdown/templates/asa/resources/template.tex @@ -11,6 +11,11 @@ $endif$ \usepackage{textcomp} +$if(verbatim-in-note)$ +% For Pandoc feature verbatim_in_note +\usepackage{fancyvrb} +$endif$ + %\pdfminorversion=4 % NOTE: To produce blinded version, replace "0" with "1" below. \newcommand{\blind}{$blinded$} @@ -96,7 +101,7 @@ \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}} $endif$ $if(verbatim-in-note)$ -\VerbatimFootnotes % allow verbatim text in footnotes +\VerbatimFootnotes % allows verbatim text in footnotes $endif$ \hypersetup{ $if(title-meta)$ diff --git a/inst/rmarkdown/templates/elsevier/resources/template.tex b/inst/rmarkdown/templates/elsevier/resources/template.tex index 24e14821e..b2633e044 100644 --- a/inst/rmarkdown/templates/elsevier/resources/template.tex +++ b/inst/rmarkdown/templates/elsevier/resources/template.tex @@ -66,6 +66,7 @@ \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} $endif$ $if(verbatim-in-note)$ +% For Pandoc feature verbatim_in_note \usepackage{fancyvrb} $endif$ $if(graphics)$ diff --git a/inst/rmarkdown/templates/glossa/resources/template.tex b/inst/rmarkdown/templates/glossa/resources/template.tex index cd9719c6f..bebe4b691 100644 --- a/inst/rmarkdown/templates/glossa/resources/template.tex +++ b/inst/rmarkdown/templates/glossa/resources/template.tex @@ -25,6 +25,11 @@ \usepackage[linguistics]{forest} %for nice trees! \usepackage{longtable} +$if(verbatim-in-note)$ +% For Pandoc feature verbatim_in_note +\usepackage{fancyvrb} +$endif$ + \title[$if(shorttitle)$$shorttitle$$endif$]{$title$$if(wordcount)$\\ \bigskip \large Word count: $wordcount$$endif$} % Optional short title inside square brackets, for the running headers. @@ -129,7 +134,6 @@ $endif$ $if(verbatim-in-note)$ -\usepackage{fancyvrb} \VerbatimFootnotes % allows verbatim text in footnotes $endif$ diff --git a/inst/rmarkdown/templates/jasa/resources/template.tex b/inst/rmarkdown/templates/jasa/resources/template.tex index f0020a3ab..72b78432d 100644 --- a/inst/rmarkdown/templates/jasa/resources/template.tex +++ b/inst/rmarkdown/templates/jasa/resources/template.tex @@ -53,6 +53,11 @@ \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} $endif$ +$if(verbatim-in-note)$ +% For Pandoc feature verbatim_in_note +\usepackage{fancyvrb} +$endif$ + $if(highlighting-macros)$ % Pandoc syntax highlighting $highlighting-macros$ @@ -113,7 +118,6 @@ $endif$ $if(verbatim-in-note)$ -\usepackage{fancyvrb} \VerbatimFootnotes % allows verbatim text in footnotes $endif$ diff --git a/inst/rmarkdown/templates/joss/resources/template.tex b/inst/rmarkdown/templates/joss/resources/template.tex index 066fccbaa..914a063c2 100644 --- a/inst/rmarkdown/templates/joss/resources/template.tex +++ b/inst/rmarkdown/templates/joss/resources/template.tex @@ -23,6 +23,11 @@ ]{biblatex} \bibliography{$bibliography$} +$if(verbatim-in-note)$ +% For Pandoc feature verbatim_in_note +\usepackage{fancyvrb} +$endif$ + % --- Page layout ------------------------------------------------------------- \usepackage[top=3.5cm, bottom=3cm, right=1.5cm, left=1.0cm, @@ -198,7 +203,6 @@ \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} $endif$ $if(verbatim-in-note)$ -\usepackage{fancyvrb} \VerbatimFootnotes % allows verbatim text in footnotes $endif$ $if(graphics)$ diff --git a/inst/rmarkdown/templates/oup_v1/resources/template.tex b/inst/rmarkdown/templates/oup_v1/resources/template.tex index 554bf515d..2a9d3f418 100644 --- a/inst/rmarkdown/templates/oup_v1/resources/template.tex +++ b/inst/rmarkdown/templates/oup_v1/resources/template.tex @@ -23,6 +23,7 @@ % From Pandoc template for its feature $if(verbatim-in-note)$ +% For Pandoc feature verbatim_in_note \usepackage{fancyvrb} $endif$ \usepackage{xcolor} @@ -137,6 +138,9 @@ % Make links footnotes instead of hotlinks: \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}} $endif$ +$if(verbatim-in-note)$ +\VerbatimFootnotes % allows verbatim text in footnotes +$endif$ $if(strikeout)$ % For pandoc feature $if(pandoc3)$ diff --git a/inst/rmarkdown/templates/pihph/resources/template.tex b/inst/rmarkdown/templates/pihph/resources/template.tex index 2364c3d48..c079f3c8e 100644 --- a/inst/rmarkdown/templates/pihph/resources/template.tex +++ b/inst/rmarkdown/templates/pihph/resources/template.tex @@ -23,6 +23,11 @@ \usepackage{graphicx} \usepackage[type={CC}, modifier={by}, version=4.0]{doclicense} +$if(verbatim-in-note)$ +% For Pandoc feature verbatim_in_note +\usepackage{fancyvrb} +$endif$ + \newcommand\affiliation[1]{{\normalfont\normalsize\itshape#1}} \pagestyle{simple} @@ -174,7 +179,6 @@ \section*{\textcolor{pihphgreen}{Comments invited}} \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} $endif$ $if(verbatim-in-note)$ -\usepackage{fancyvrb} \VerbatimFootnotes % allows verbatim text in footnotes $endif$