Beamer Section Titles with Shortened Titles in Top Bar of Slides

beamertitles

I would like to have multiple slides with a titles for sections that place the title of the section in a box similar to the main title for the slides. @gonzalomedina helped by recommending the code:

\documentclass{beamer}
\usetheme{Madrid}

\AtBeginSection[]{
  \begin{frame}
  \vfill
  \centering
  \begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title}
    \usebeamerfont{title}\insertsectionhead\par%
  \end{beamercolorbox}
  \vfill
  \end{frame}
}

\title{The Title}
\author{The Author}
\institute{The Institute}

\begin{document}

\begin{frame}
\maketitle
\end{frame}

\section{Test section one}
\begin{frame}
test frame for section one
\end{frame}

\section{Test section two}
\begin{frame}
test frame for section two
\end{frame}

\end{document}

This is great except that I am using the Frankfurt theme, so the title of each section is going into the top bar. My question: How do I get the long titles in the boxes at the start of each section but have a shortened phrase as the top bar "title"? Thanks.

This question is a follow-up to: Creating sections each with title pages in beamers slides

Best Answer

Instead of \insertsectionhead, you can use \secname for the boxes at the beginning of each section; also, use the optional argument for \section to provide a short version for the navigation bar in the headline:

\documentclass{beamer}
\usetheme{Frankfurt}

\AtBeginSection[]{
  \begin{frame}
  \vfill
  \centering
  \begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title}
    \usebeamerfont{title}\secname\par%
  \end{beamercolorbox}
  \vfill
  \end{frame}
}

\title{The Title}
\author{The Author}
\institute{The Institute}

\begin{document}

\begin{frame}
\maketitle
\end{frame}

\section[Test section one]{Test section one with a really reallly long title}
\begin{frame}
test frame for section one
\end{frame}

\section[Test section two]{Test section two with a really reallly long title}
\begin{frame}
test frame for section two
\end{frame}

\end{document}

An image of the frame at the beginning of the first section showing the long full title in the box and the short version in the navigation bar.

enter image description here