From fd222b811b584df31651b3b4657941fc8a44eb62 Mon Sep 17 00:00:00 2001 From: Andrew Dunning Date: Fri, 11 Jan 2019 14:17:53 -0500 Subject: 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, . 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. --- data/templates/default.latex | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'data') 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)$ -- cgit v1.2.3