1

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

1 Answer 1

3

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)

0

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .