diff --git a/data/templates/default.latex b/data/templates/default.latex
index 04784b971..61402c605 100644
--- a/data/templates/default.latex
+++ b/data/templates/default.latex
@@ -36,6 +36,35 @@ $for(classoption)$
   $classoption$$sep$,
 $endfor$
 ]{$documentclass$}
+$if(title)$
+\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
+$endif$
+$if(subtitle)$
+$if(beamer)$
+$else$
+\usepackage{etoolbox}
+\makeatletter
+\providecommand{\subtitle}[1]{% add subtitle to \maketitle
+  \apptocmd{\@title}{\par {\large #1 \par}}{}{}
+}
+\makeatother
+$endif$
+\subtitle{$subtitle$}
+$endif$
+\author{$for(author)$$author$$sep$ \and $endfor$}
+\date{$date$}
+$if(beamer)$
+$if(institute)$
+\institute{$for(institute)$$institute$$sep$ \and $endfor$}
+$endif$
+$if(titlegraphic)$
+\titlegraphic{\includegraphics{$titlegraphic$}}
+$endif$
+$if(logo)$
+\logo{\includegraphics{$logo$}}
+$endif$
+$endif$
+
 $if(beamer)$
 $if(background-image)$
 \usebackgroundtemplate{%
@@ -423,35 +452,6 @@ $if(csquotes)$
 \usepackage{csquotes}
 $endif$
 
-$if(title)$
-\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
-$endif$
-$if(subtitle)$
-$if(beamer)$
-$else$
-\usepackage{etoolbox}
-\makeatletter
-\providecommand{\subtitle}[1]{% add subtitle to \maketitle
-  \apptocmd{\@title}{\par {\large #1 \par}}{}{}
-}
-\makeatother
-$endif$
-\subtitle{$subtitle$}
-$endif$
-\author{$for(author)$$author$$sep$ \and $endfor$}
-\date{$date$}
-$if(beamer)$
-$if(institute)$
-\institute{$for(institute)$$institute$$sep$ \and $endfor$}
-$endif$
-$if(titlegraphic)$
-\titlegraphic{\includegraphics{$titlegraphic$}}
-$endif$
-$if(logo)$
-\logo{\includegraphics{$logo$}}
-$endif$
-$endif$
-
 \begin{document}
 $if(has-frontmatter)$
 \frontmatter
diff --git a/test/lhs-test.latex b/test/lhs-test.latex
index fdc344335..20bc6ae19 100644
--- a/test/lhs-test.latex
+++ b/test/lhs-test.latex
@@ -4,6 +4,9 @@
 %
 \documentclass[
 ]{article}
+\author{}
+\date{}
+
 \usepackage{amsmath,amssymb}
 \usepackage{lmodern}
 \usepackage{iftex}
@@ -85,9 +88,6 @@
   \usepackage{selnolig}  % disable illegal ligatures
 \fi
 
-\author{}
-\date{}
-
 \begin{document}
 
 \hypertarget{lhs-test}{%
diff --git a/test/lhs-test.latex+lhs b/test/lhs-test.latex+lhs
index f9149ba02..327dac4ef 100644
--- a/test/lhs-test.latex+lhs
+++ b/test/lhs-test.latex+lhs
@@ -4,6 +4,9 @@
 %
 \documentclass[
 ]{article}
+\author{}
+\date{}
+
 \usepackage{amsmath,amssymb}
 \usepackage{lmodern}
 \usepackage{iftex}
@@ -52,9 +55,6 @@
   \usepackage{selnolig}  % disable illegal ligatures
 \fi
 
-\author{}
-\date{}
-
 \begin{document}
 
 \hypertarget{lhs-test}{%
diff --git a/test/writer.latex b/test/writer.latex
index abf772df4..468c271bc 100644
--- a/test/writer.latex
+++ b/test/writer.latex
@@ -4,6 +4,10 @@
 %
 \documentclass[
 ]{article}
+\title{Pandoc Test Suite}
+\author{John MacFarlane \and Anonymous}
+\date{July 17, 2006}
+
 \usepackage{amsmath,amssymb}
 \usepackage{lmodern}
 \usepackage{iftex}
@@ -67,10 +71,6 @@
   \usepackage{selnolig}  % disable illegal ligatures
 \fi
 
-\title{Pandoc Test Suite}
-\author{John MacFarlane \and Anonymous}
-\date{July 17, 2006}
-
 \begin{document}
 \maketitle
 
diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex
index d91f77325..e06fe05ed 100644
--- a/test/writers-lang-and-dir.latex
+++ b/test/writers-lang-and-dir.latex
@@ -5,6 +5,9 @@
 \documentclass[
   english,
 ]{article}
+\author{}
+\date{}
+
 \usepackage{amsmath,amssymb}
 \usepackage{lmodern}
 \usepackage{iftex}
@@ -84,9 +87,6 @@
   \newenvironment{LTR}{\beginL}{\endL}
 \fi
 
-\author{}
-\date{}
-
 \begin{document}
 
 \hypertarget{empty-divs-and-spans}{%