From c9cf8568bfda40cc8027a2eb6b7f87ba296fbd23 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Mon, 14 Mar 2022 12:28:56 -0700
Subject: [PATCH] LaTeX template: Fix regression with code in footnotes...

...due to moving hyperref later in the template.

Closes #7964.
---
 data/templates/default.latex | 6 +++---
 test/writer.latex            | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/data/templates/default.latex b/data/templates/default.latex
index c25f75ff0..f77be2fa0 100644
--- a/data/templates/default.latex
+++ b/data/templates/default.latex
@@ -212,9 +212,6 @@ $endif$
 \usepackage{xcolor}
 \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
 \urlstyle{same} % disable monospaced font for URLs
-$if(verbatim-in-note)$
-\VerbatimFootnotes % allow verbatim text in footnotes
-$endif$
 $if(geometry)$
 $if(beamer)$
 \geometry{$for(geometry)$$geometry$$sep$,$endfor$}
@@ -381,6 +378,9 @@ $if(csquotes)$
 \usepackage{csquotes}
 $endif$
 \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
+$if(verbatim-in-note)$
+\VerbatimFootnotes % allow verbatim text in footnotes
+$endif$
 \hypersetup{
 $if(title-meta)$
   pdftitle={$title-meta$},
diff --git a/test/writer.latex b/test/writer.latex
index 554efc7b6..5e93840e4 100644
--- a/test/writer.latex
+++ b/test/writer.latex
@@ -36,7 +36,6 @@
 \usepackage{xcolor}
 \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
 \urlstyle{same} % disable monospaced font for URLs
-\VerbatimFootnotes % allow verbatim text in footnotes
 \usepackage{graphicx}
 \makeatletter
 \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
@@ -59,6 +58,7 @@
   \usepackage{selnolig}  % disable illegal ligatures
 \fi
 \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
+\VerbatimFootnotes % allow verbatim text in footnotes
 \hypersetup{
   pdftitle={Pandoc Test Suite},
   pdfauthor={John MacFarlane; Anonymous},