0

To include some heading (just above the content) in a beamer frame, I am using this code:

\makeatletter
\let\oldframe\frame
\def\frame{\@ifnextchar[\frame@i \frame@ii}
\def\frame@i[#1]{\oldframe[#1] Heading}
\def\frame@ii{\oldframe Heading}
\makeatother

It works well along with all options, but the frame title appears at an odd location (along with the content, instead of the normal top position). Does anybody know how to fix it?

A minimal working example:

\documentclass{beamer}
\makeatletter
\let\oldframe\frame
\def\frame{\@ifnextchar[\frame@i \frame@ii}
\def\frame@i[#1]{\oldframe[#1] Heading}
\def\frame@ii{\oldframe Heading}
\makeatother

\begin{document}
\begin{frame}{Title}
The title does not appear as expected
\end{frame}
\end{document}
  • 1
    This might cause trouble for fragile frames. – user36296 Jun 16 '18 at 11:47
2

I don't recommend the redefinition of the frame environment. This can cause problems, especially with fragile content.

If you really must do it:

\documentclass{beamer}

\newenvironment{myframe}[1]
    {\begin{frame}[environment=myframe]
        \frametitle{#1}
        Heading\par
        }
    {\end{frame}}


\begin{document}
\begin{myframe}{Title}
The title does not appear as expected
\end{myframe}

\end{document}

(see beamer user guide, section 8.1, for more information)

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.