1

How can I make a title page in beamer start with just a main title line then on each successive click add a subtitle line and a second subtitle line? And it is important that the already-visible lines will not move, meaning that they should be displayed to their final position initially.

Here is a hack that nearly accomplishes what I am going for:

\documentclass{beamer}
\usetheme{default}
\begin{document}
\title{Title Line}
\subtitle{\vspace{\baselineskip} \vspace{\baselineskip}}
\maketitle
\title{Title Line}
\subtitle{Subtitle Line 1 \vspace{\baselineskip}}
\maketitle
\title{Title Line}
\subtitle{Subtitle Line 1 \\ Subtitle Line 2}
\maketitle
\end{document}

However, notice that (at least in my render of the document) the middle title slide (that has only one of the two subtitles) does not have the middle subtitle line in the same position and size precisely as it ends up in on the third slide, so this looks awkward when transferring between these.

Note that I am using a blank \subtitle with \vspace{\baselineskip} so that the first slide shows the title line in a correct final position. (Although this is an issue sometimes, not in this particular code but when I plug in the actual text I want the title line 'jumps' a few pixels between the slides… this is my main issue, and can be seen in this example on the subtitle between slides 2 and 3)

3
  • 1
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Apr 30, 2016 at 21:06
  • The way to go would be to add something along the line of \visible<+>{...} to the definition of the title page, but without knowing which theme is used, posting an answer would require looking into a crystal ball. Apr 30, 2016 at 21:12
  • I am using the default theme, just starting using beamer so it's the only one I know / would like to stick to. How can I add this \visible statement to the title/subtitle defined in the theme? Apr 30, 2016 at 21:31

2 Answers 2

1

By replacing \insertsubtitle with \visible<2>{\insertsubtitle} in the default definition of the titlepage, the subtitle gets only visible on the second slide, but its space is already reserved on the first slide.

For more information, I recommend the the section about overlays in the beameruserguide.

\documentclass{beamer}
\usetheme{default}

\title{bla}
\subtitle{blub}

\makeatletter
\setbeamertemplate{title page}
{
    \vbox{}
    \vfill
    \begingroup
    \centering
    \begin{beamercolorbox}[sep=8pt,center]{title}
        \usebeamerfont{title}\inserttitle\par%
        \ifx\insertsubtitle\@empty%
        \else%
        \vskip0.25em%
        {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\visible<2>{\insertsubtitle}\par}%
        \fi%     
    \end{beamercolorbox}%
    \vskip1em\par
    \begin{beamercolorbox}[sep=8pt,center]{author}
        \usebeamerfont{author}\insertauthor
    \end{beamercolorbox}
    \begin{beamercolorbox}[sep=8pt,center]{institute}
        \usebeamerfont{institute}\insertinstitute
    \end{beamercolorbox}
    \begin{beamercolorbox}[sep=8pt,center]{date}
        \usebeamerfont{date}\insertdate
    \end{beamercolorbox}\vskip0.5em
    {\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
    \endgroup
    \vfill
}
\makeatother

\begin{document}
\begin{frame}
    \titlepage
\end{frame}
\end{document}

enter image description here


EDIT:

A quick hack to get a second line:

\documentclass{beamer}
\usetheme{default}

\title{bla}
\subtitle{blub}

\makeatletter
\setbeamertemplate{title page}
{
    \vbox{}
    \vfill
    \begingroup
    \centering
    \begin{beamercolorbox}[sep=8pt,center]{title}
        \usebeamerfont{title}\inserttitle\par%
        \ifx\insertsubtitle\@empty%
        \else%
        \vskip0.25em%
        {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}%
            \visible<2->{\insertsubtitle}

            \visible<3>{I am a second line}\par}%
        \fi%     
    \end{beamercolorbox}%
    \vskip1em\par
    \begin{beamercolorbox}[sep=8pt,center]{author}
        \usebeamerfont{author}\insertauthor
    \end{beamercolorbox}
    \begin{beamercolorbox}[sep=8pt,center]{institute}
        \usebeamerfont{institute}\insertinstitute
    \end{beamercolorbox}
    \begin{beamercolorbox}[sep=8pt,center]{date}
        \usebeamerfont{date}\insertdate
    \end{beamercolorbox}\vskip0.5em
    {\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
    \endgroup
    \vfill
}
\makeatother

\begin{document}
\begin{frame}
    \titlepage
\end{frame}
\end{document}
6
  • Thanks. Ideally there would be a simpler way than changing the template though, any ideas in that direction? Apr 30, 2016 at 22:03
  • Also, can this be used to insert two sequential subtitle lines? Apr 30, 2016 at 22:04
  • @DanielNaftalovich Instead of changing it, one could also patch it. In my opinion, both is simpler than doing voodoo with the argument of \subtitle{}. As informations like this are reused at different places of a presentation and its meta data, this can cause serious problems. Apr 30, 2016 at 22:07
  • @DanielNaftalovich As for the second line, see the edit. Apr 30, 2016 at 22:14
  • Works beautifully, thanks so much. I ended up defining \newcommand{\subsubtitle}{second subtitle line text} above the template hacking just to keep things separately, and then calling the \visible<3>{\subsubtitle}\par} line like this. I think this makes it easier to keep the code straight (you can edit it in your answer as it may help others to read through it). Apr 30, 2016 at 22:21
1

The existing answer here is great, but is a bit unfortunate in that you have to modify the template title page from scratch. You can get around that by only redefining \insertsubtitle, like this:

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\title{Foobar}
\subtitle{baz}

\begin{document}

\let\oldinsertsubtitle\insertsubtitle
\renewcommand{\insertsubtitle}[1]{\visible<2->{\oldinsertsubtitle{#1}}}
\maketitle

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.