I am using the following code in my beamer document to make the frame title's appear in the table of contents:
\documentclass{beamer}
\usetheme{default}
\usepackage{bookmark}
\usepackage{etoolbox}
\usepackage{graphicx}
\makeatletter
\apptocmd{\beamer@@frametitle}{
\addtocontents{toc}
{\protect\beamer@subsectionintoc{\the\c@section}{0}{#1}
{\the\c@page}{\the\c@part}
{\the\beamer@tocsectionnumber}}
\bookmark[page=\the\c@page,level=3]{#1}}
{\message{** patching of \string\beamer@@frametitle succeeded **}}%
{\message{** patching of \string\beamer@@frametitle failed **}}%
\makeatother
\begin{document}
\begin{frame}[label=toc]{Table of Contents}
\tableofcontents
\end{frame}
\section{First Section}
\begin{frame}{One}
content
\end{frame}
\section{Second Section}
\begin{frame}{Two}
Content
\end{frame}
\section{Third Section}
\begin{frame}{Three}
Content
\end{frame}
\end{document}
What I am trying to do is understand what the solution does because I now want to add block titles to the table of contents as well as frame titles and I imagine that would be an easy function to add if I understood the code. Please help by re-writing the code (if possible) without the \makeatletter
substitution command, using other latex commands.
Here are some related posts:
Make each frame (not slide) appear in the PDF bookmarks with beamer
\makeatletter
command is needed because you want to modify the behavior of\beamer@@frametitle
; it has no particular meaning; the second linked question explains why you need it.