aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorAndrew Dunning <adunning@users.noreply.github.com>2019-01-11 14:17:53 -0500
committerJohn MacFarlane <jgm@berkeley.edu>2019-01-11 11:17:53 -0800
commitfd222b811b584df31651b3b4657941fc8a44eb62 (patch)
tree3201b906fb11b9c277ebefc9b56ef37323a67bec /data
parent24a0d613a87245c193f7cc3b4a6bf1391a7eb6a8 (diff)
downloadpandoc-fd222b811b584df31651b3b4657941fc8a44eb62.tar.gz
LaTeX template: Render \subtitle (#5213)
Addresses closed issues #4675, #3896, #1327. This renders `\subtitle` using the `etoolbox` package if `\subtitle` is not already defined by the documentclass (as it is in beamer, KOMA, memoir classes). Based on an example from Enrico Gregorio, <https://tex.stackexchange.com/a/50186>. Update list of LaTeX packages. Note that `etoolbox` must be loaded outside the command definition. Putting it inside causes an error if `\title` is placed after `\begin{document}`. It's already loaded on LuaLaTeX/XeLaTeX in any case.
Diffstat (limited to 'data')
-rw-r--r--data/templates/default.latex10
1 files changed, 9 insertions, 1 deletions
diff --git a/data/templates/default.latex b/data/templates/default.latex
index 0701054c0..1691f3a21 100644
--- a/data/templates/default.latex
+++ b/data/templates/default.latex
@@ -350,7 +350,15 @@ $if(title)$
\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
$endif$
$if(subtitle)$
-\providecommand{\subtitle}[1]{}
+$if(beamer)$
+$else$
+\usepackage{etoolbox}
+\makeatletter
+\providecommand{\subtitle}[1]{% add subtitle to \maketitle
+ \apptocmd{\@title}{\par {\large #1}}{}{}
+}
+\makeatother
+$endif$
\subtitle{$subtitle$}
$endif$
$if(author)$