2

I have a title which is to be shown in all the frames. Please note that, this is not the usual frame title, but a floating title (or some text) just above the frame content. This can be easily achieved by adding the title (or the text) in the frame environment.

The issue comes when frame break is allowed. When a frame is split, the title appears only on the first slide. Is there any way to get the title in the remaining slides as well ?

A MWE

\documentclass{beamer}
\begin{document}
\begin{frame}[allowframebreaks]
\textbf{The Title}
The content that spans over many pages
\end{frame}
\end{document}
  • 1
    You could add the title to the start of every frame, using the second approach outlined in another answer. – Coby Viner Jun 15 '18 at 18:38
  • 1
    Thank you very much @CobyViner, it works, but with a big drawback - the title is now repeated two times (eg: "TitleTitle" - in the same slide) on all split slides. – Ashok Jun 15 '18 at 18:59
  • allowframebreaks is fairly evil. You really shouldn't be using it. – cfr Jun 16 '18 at 1:20
2

Quote from the beamer user guide about [allowframebreaks]:

The use of this option is evil.

\documentclass{beamer}

\newcommand{\floattitle}[1]{%
    \begin{beamercolorbox}[sep=0.3cm,left,wd=\paperwidth]{frametitle}
     \usebeamerfont{frametitle}%
     \vbox{}\vskip-1ex%
     \strut#1\strut\par%
     \vskip-1ex%
    \end{beamercolorbox}%
}

\makeatletter 
\renewenvironment{beamer@frameslide}{%
  \ifbeamer@autobreak\else%
    \ifx\beamer@againname\@empty%
      {\let\@elt\beamer@restorecounter\beamer@overlaycounterresets}%
    \else%
      {\let\@elt\beamer@labelrestorecounter\beamer@overlaycounterresets}%
    \fi%
  \fi%
  \global\c@beamerpauses=1\relax%
  \expandafter\ifblank\expandafter{\beamer@framestartpage}{%
    \stepcounter{subsectionslide}%
    \xdef\beamer@framestartpage{\the\c@page}% only first time
  }{\clearpage\beamer@notesactions}% cleanup from previous slide
  \hypersetup{pdfpagetransition=R}%
  \hypersetup{pdfpageduration=}%
  \@ifundefined{thispdfpagelabel}{}{%
  \thispdfpagelabel{\insertframenumber}}%
  \xdef\beamer@frameendpage{\the\c@page}% every time
  \xdef\beamer@slidenumber{\the\numexpr\c@page-\beamer@framestartpage+1\relax}%
  \xdef\beamer@overlaynumber{\the\beamer@slideinframe}%
  \beamer@setuplinks%
  \beamer@displaybreak%
  \global\setbox\beamer@zoombox=\box\voidb@x%
  \def\beamer@zoomer{}%
  \beamer@slidehaszoomfalse%
  \gdef\insertframetitle{}%
  \gdef\insertframesubtitle{}%
  \gdef\beamer@frametitle{}%
  \gdef\beamer@shortframetitle{}%
  \gdef\beamer@framesubtitle{}%
  \let\beamer@startcomment=\beamer@startcommentinframe%
  % Start slide:
  \beamer@framenotesbegin%
    \global\setbox\beamer@framebox=\vbox\bgroup%
    \beamer@inframetrue%
    \let\frame=\framelatex% inside frames, use LaTeX's \frame command
    \begin{beamer@framepauses}%
      \refcounter{framenumber}%use frame number for  \label
      \ifbeamer@shrink%
        \hsize=\beamer@shrinkfactorinv\hsize%
        \textwidth=\beamer@shrinkfactorinv\textwidth%
        \linewidth=\beamer@shrinkfactorinv\linewidth%
      \fi%
      % Insert labels if necessary:
      \ifx\beamer@againname\@empty\else%
        \nointerlineskip\vbox to0pt{\vss%
        \label<\the\beamer@slideinframe>{\beamer@againname<\the\beamer@slideinframe>}%
        \ifnum\beamer@slideinframe=1\relax%
          \label<1>{\beamer@againname}%
        \fi%
        }\nointerlineskip%
      \fi%
      \ifx\beamer@framehypertargets\@empty\else%
        \nointerlineskip\vbox to0pt{\vss%
          \beamer@framehypertargets%
          \global\let\beamer@framehypertargets\@empty%
        }\nointerlineskip%
      \fi%
      \vskip-\parskip\vbox{}%
      \ifbeamer@plainframe\nointerlineskip\fi%
    \beamer@checkframetitle}%
    {\par
    \end{beamer@framepauses}%
  \egroup%
  \ifx\beamer@frametitle\@empty%
    \setbox\beamer@frametitlebox=\box\voidb@x%
  \else%
    \setbox\beamer@frametitlebox=\vbox{%
      \vbox{}%
      {\parskip0pt\usebeamertemplate***{frametitle}\vskip0.25em}%
    }%
  \fi%
  \ifbeamer@plainframe%
    \beamer@frametextheight=\paperheight%
  \else%
    \beamer@frametextheight=\textheight%
  \fi%
  \advance\beamer@frametextheight by-\ht\beamer@frametitlebox%
  \advance\beamer@frametextheight by-\dp\beamer@frametitlebox%
  \advance\beamer@frametextheight by-\beamer@frametopskip%
  \ifbeamer@shrink%
    \beamer@shrinkframebox%
  \fi%
  \ifx\beamer@zoomer\@empty
    \setbox\beamer@framebox=\vbox{%
      \nobreak\vbox{}\nobreak\par\nobreak\beamer@entrycode\nobreak%
      \nointerlineskip\unvbox\beamer@frametitlebox%
      \nobreak%
      \ifbeamer@autobreak%
        \vskip\beamer@frametopskipautobreak%
            \floattitle{Frame title}
      \else%
        \vskip\beamer@frametopskip%
      \fi%
      \nobreak%
      \nointerlineskip\box\beamer@zoombox\nointerlineskip%
      \nobreak%
      \ifbeamer@slidehaszoom\box\beamer@framebox\else\unvbox\beamer@framebox\fi%
      % bottom skip is added in autobreakframebox
    }%
    \beamer@autobreakframebox%
  \else%
    \beamer@zoomer%
  \fi%
  \beamer@undolabels%
  \beamer@framenotesend%
  \box\beamer@framebox}


\pretocmd\beamer@checkframetitle{
    \ifbeamer@localanotherslide
    \else
        \floattitle{Frame title}
    \fi
} 
\makeatother

\begin{document}

\begin{frame}
The new arrangment
\end{frame}

\begin{frame}[allowframebreaks]
%\floattitle{Frame title}
The new arrangment

\framebreak

%\floattitle{Frame title}
test
\end{frame}
\end{document}

enter image description here

The idea to check localanotherslide is from \ifbeamer@anotherslide and \ifbeamer@localanotherslide in beamerbasedecode.sty

  • That worked well. Thank you very much for your effort dear Sam. – Ashok Jun 16 '18 at 18:44

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.