58

Does there exist some command for subtitles in the \maketitle thing?

Torbjørn T.
  • 206,688
hhh
  • 8,743
  • 11
    The titlepage environment can be used to create a title page with everything you need. The standard classes don't even try to provide "everything" one could need. You can look at the titling package for getting aid in designing a title. – egreg Mar 31 '12 at 12:15

4 Answers4

61

With the titling package one can define a \subtitle command as follows:

\documentclass[a4paper]{article}
\usepackage{titling}
\newcommand{\subtitle}[1]{%
  \posttitle{%
    \par\end{center}
    \begin{center}\large#1\end{center}
    \vskip0.5em}%
}

\begin{document}

\title{(Title)}
\subtitle{(Subtitle)}

\author{(Author)}

\maketitle

\end{document}

The trick is that titling redefines \maketitle so that it executes, among other things

<pretitle tokens> <title tokens> <posttitle tokens>

and what goes in <posttitle tokens> is set by

\posttitle{tokens}

The default, as made clear in the documentation, is

  \posttitle{\par\end{center}\vskip0.5em}

so what's needed is to insert something in between.

enter image description here

egreg
  • 1,121,712
  • ...how about subsubsub...title? – hhh Mar 31 '12 at 14:18
  • @hhh What do you mean? – egreg Mar 31 '12 at 14:19
  • Like is it possible to have \subsubtitle{...}? At least with the \title{...} linebreaks do not work in title -element \title{oneLine\n newLine}. – hhh Mar 31 '12 at 14:29
  • 5
    Use \\ to force a line break. – egreg Mar 31 '12 at 14:49
  • @egreg Thanks for the helpful solution here. Unfortunately I'm running into an error when trying to include an abstract and multiple authors. I posted a separate question about the issue here: http://tex.stackexchange.com/questions/285711/subtitle-abstract-and-multiple-authors-using-titling-package – EthanAlvaree Jan 03 '16 at 05:22
  • @EthanAlvaree I believe there's no hope in making titling to cooperate with amsart. – egreg Jan 03 '16 at 10:48
  • I've attempted something similar involving invoking \posttitle with the code to close off \pretitle first, then, inside \subtitle, \letting \oldposttitle to it before redefining \posttitle to use \oldposttitle, but I wasn't able to get it to work the same way… – RandomDSdevel May 24 '18 at 22:49
  • @RandomDSdevel Probably a fresh question with the attempt and the aim is better. – egreg May 24 '18 at 22:50
  • @egreg: Eh, I got something else to work, so it's not really that important any more; I just wanted to add what I said as a note. – RandomDSdevel May 26 '18 at 23:38
  • See my separate answer for an example that works with amsart. – Andrew Dunning Jan 11 '19 at 02:57
  • Thanks this approach works better than the others, since it's more compatible with other sytles. – loretoparisi May 14 '20 at 12:04
45

In the standard classes: no. In the KOMA-Script classes: yes.

\documentclass{scrartcl}

\begin{document}

\title{(Title)}
\subtitle{(Subtitle)}
\author{(Author)}

\maketitle

\end{document}

enter image description here

lockstep
  • 250,273
8

Remember also that you can easily make subtitle with a little hack:

\title{This is the main title of my work.\\ \small And this is the subtitle}

In most cases, it works very well.

G M
  • 2,225
1

I was inspired by Enrico's suggestion, but didn't want to use the titling package because it's not included in BasicTeX and some other minimal TeX distributions, so I added a subtitle using etoolbox instead. This also won't clash with KOMA-Script or other classes that add their own version of \subtitle:

\documentclass{article}

\usepackage{etoolbox}
\makeatletter
\providecommand{\subtitle}[1]{% add subtitle to \maketitle
  \apptocmd{\@title}{\par {\large #1 \par}}{}{}
}
\makeatother

\begin{document}

\title{(Title)}
\subtitle{(Subtitle)}
\author{(Author)}

\maketitle

\end{document}
Andrew Dunning
  • 1,714
  • 13
  • 21
  • 3
    Don't place the \usepackage{etoolbox} inside the definition of \subtitle. – Werner Jan 11 '19 at 02:55
  • Is there a reason for that? The idea was to load etoolbox only if the command were used. – Andrew Dunning Jan 11 '19 at 02:59
  • 2
    You call \title inside the preamble (before \begin{document}). However, without your patch, you can call \title after \begin{document}. One issue, \usepackage can only be used inside the preamble which forces \title to be used in the preamble. It's just not common practice. – Werner Jan 11 '19 at 03:53