git.iko.soy/typeable/pandoc
on master help sign in
Revert "LaTeX template: move title, author, date up to top of preamble."

This reverts commit cc088687b4013c2b8b744eb337ed04fc63f315f2 and PR #7295. This fixes issues people had when using LaTeX commands defined later in the preamble (or in some cases UTF-8 text) in the title or author fields. Closes #7422.

commit972db3cdcac19bca0dd4e0957514a48bbf1feacb authorJohn MacFarlane <jgm@berkeley.edu> dateSat 3 Jul 2021, 15:21 (5 years ago) parente00e5a4
5 files changed+42−42
data/templates/default.latex+29−29 test/lhs-test.latex+3−3 test/lhs-test.latex+lhs+3−3 test/writer.latex+4−4 test/writers-lang-and-dir.latex+3−3
data/templates/default.latex+29−29
@@ -36,35 +36,6 @@ $for(classoption)$
3636 $classoption$$sep$,
3737$endfor$
3838]{$documentclass$}
39−$if(title)$
40−\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
41−$endif$
42−$if(subtitle)$
43−$if(beamer)$
44−$else$
45−\usepackage{etoolbox}
46−\makeatletter
47−\providecommand{\subtitle}[1]{% add subtitle to \maketitle
48− \apptocmd{\@title}{\par {\large #1 \par}}{}{}
49−}
50−\makeatother
51−$endif$
52−\subtitle{$subtitle$}
53−$endif$
54−\author{$for(author)$$author$$sep$ \and $endfor$}
55−\date{$date$}
56−$if(beamer)$
57−$if(institute)$
58−\institute{$for(institute)$$institute$$sep$ \and $endfor$}
59−$endif$
60−$if(titlegraphic)$
61−\titlegraphic{\includegraphics{$titlegraphic$}}
62−$endif$
63−$if(logo)$
64−\logo{\includegraphics{$logo$}}
65−$endif$
66−$endif$
67−
6839$if(beamer)$
6940$if(background-image)$
7041\usebackgroundtemplate{%
@@ -452,6 +423,35 @@ $if(csquotes)$
452423\usepackage{csquotes}
453424$endif$
454425
426+$if(title)$
427+\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
428+$endif$
429+$if(subtitle)$
430+$if(beamer)$
431+$else$
432+\usepackage{etoolbox}
433+\makeatletter
434+\providecommand{\subtitle}[1]{% add subtitle to \maketitle
435+ \apptocmd{\@title}{\par {\large #1 \par}}{}{}
436+}
437+\makeatother
438+$endif$
439+\subtitle{$subtitle$}
440+$endif$
441+\author{$for(author)$$author$$sep$ \and $endfor$}
442+\date{$date$}
443+$if(beamer)$
444+$if(institute)$
445+\institute{$for(institute)$$institute$$sep$ \and $endfor$}
446+$endif$
447+$if(titlegraphic)$
448+\titlegraphic{\includegraphics{$titlegraphic$}}
449+$endif$
450+$if(logo)$
451+\logo{\includegraphics{$logo$}}
452+$endif$
453+$endif$
454+
455455\begin{document}
456456$if(has-frontmatter)$
457457\frontmatter
test/lhs-test.latex+3−3
@@ -4,9 +4,6 @@
44%
55\documentclass[
66]{article}
7−\author{}
8−\date{}
9−
107\usepackage{amsmath,amssymb}
118\usepackage{lmodern}
129\usepackage{iftex}
@@ -88,6 +85,9 @@
8885 \usepackage{selnolig} % disable illegal ligatures
8986\fi
9087
88+\author{}
89+\date{}
90+
9191\begin{document}
9292
9393\hypertarget{lhs-test}{%
test/lhs-test.latex+lhs+3−3
@@ -4,9 +4,6 @@
44%
55\documentclass[
66]{article}
7−\author{}
8−\date{}
9−
107\usepackage{amsmath,amssymb}
118\usepackage{lmodern}
129\usepackage{iftex}
@@ -55,6 +52,9 @@
5552 \usepackage{selnolig} % disable illegal ligatures
5653\fi
5754
55+\author{}
56+\date{}
57+
5858\begin{document}
5959
6060\hypertarget{lhs-test}{%
test/writer.latex+4−4
@@ -4,10 +4,6 @@
44%
55\documentclass[
66]{article}
7−\title{Pandoc Test Suite}
8−\author{John MacFarlane \and Anonymous}
9−\date{July 17, 2006}
10−
117\usepackage{amsmath,amssymb}
128\usepackage{lmodern}
139\usepackage{iftex}
@@ -71,6 +67,10 @@
7167 \usepackage{selnolig} % disable illegal ligatures
7268\fi
7369
70+\title{Pandoc Test Suite}
71+\author{John MacFarlane \and Anonymous}
72+\date{July 17, 2006}
73+
7474\begin{document}
7575\maketitle
7676
test/writers-lang-and-dir.latex+3−3
@@ -5,9 +5,6 @@
55\documentclass[
66 english,
77]{article}
8−\author{}
9−\date{}
10−
118\usepackage{amsmath,amssymb}
129\usepackage{lmodern}
1310\usepackage{iftex}
@@ -87,6 +84,9 @@
8784 \newenvironment{LTR}{\beginL}{\endL}
8885\fi
8986
87+\author{}
88+\date{}
89+
9090\begin{document}
9191
9292\hypertarget{empty-divs-and-spans}{%