There is a way to make TOC using \tableofcontents, but there are only sections and subsections.
How can I get list of all frames without using sectioning?
There is a way to make TOC using \tableofcontents, but there are only sections and subsections.
How can I get list of all frames without using sectioning?
Here's a simple approach using the \@starttoc command through the newly defined \listofframes command; the new list will have extension .lbf. \addtobeamertemplate was used so that the frametitle command writes the desired information (frame number and title) to the .lbf file. The list is created issuing \listofframes:
\documentclass{beamer}
\makeatletter
\newcommand\listofframes{\@starttoc{lbf}}
\makeatother
\addtobeamertemplate{frametitle}{}{%
\addcontentsline{lbf}{section}{\protect\makebox[2em][l]{%
\protect\usebeamercolor[fg]{structure}\insertframenumber\hfill}%
\insertframetitle\par}%
}
\begin{document}
\begin{frame}
\frametitle{List of Frames}
\listofframes
\end{frame}
\begin{frame}
\frametitle{Test Frame One}
test
\end{frame}
\begin{frame}
\frametitle{Test Frame Two}
test
\end{frame}
\end{document}
Here's the resulting List of Frames:

To facilitate control over which frames to include in the new list, you can use a boolean switch; in the following example I used \ifframeinlbf initially set to true; if you want to suppress some titled frame(s) from the list of frames, use \frameinlbffalse right before those frame(s) and then use \frameinlbftrue right after the frame(s) to activate inclusion in the list:
\documentclass{beamer}
\newif\ifframeinlbf
\frameinlbftrue
\makeatletter
\newcommand\listofframes{\@starttoc{lbf}}
\makeatother
\addtobeamertemplate{frametitle}{}{%
\ifframeinlbf
\addcontentsline{lbf}{section}{\protect\makebox[2em][l]{%
\protect\usebeamercolor[fg]{structure}\insertframenumber\hfill}%
\insertframetitle\par}%
\else\fi
}
\begin{document}
\frameinlbffalse
\begin{frame}
\frametitle{List of Frames}
\listofframes
\end{frame}
\frameinlbftrue
\begin{frame}
\frametitle{Test Frame One}
test
\end{frame}
\begin{frame}
\frametitle{Test Frame Two}
test
\end{frame}
\end{document}
Done.
Thank you
– kryksyh May 19 '12 at 20:59\frameinlbftrue doesn't turn frameinlbf to true when placed inside {document}
– kryksyh
May 19 '12 at 21:41
\frameinlbftrue inside a frame environment? (it must go outside the frame environment) If this is not the problem, I will need to see some code showing the undesired behaviour.
– Gonzalo Medina
May 19 '12 at 21:46
ignorenonframetext option in \documentclass. All non-frame text including \frameinlbftrue was skipping.
– kryksyh
May 19 '12 at 22:12
allowframebreaks option. I get a "TeX capacity exceeded" error, supposedly because of the internal handling of automatic frame breaks in the beamer code. Thx for a comment on your original solution.
– mfg
Mar 14 '19 at 16:25
allowframebreaks by making usebeamertemplate robust. Add this to the preamble:
usepackage{makerobust}
\MakeRobustCommand\usebeamertemplate
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing I}' orI$' or `I\par'.
In addition to Gonzalo Medina's answer, if you want frame titles to link to page numbers, use this code just before the \insertframetitle:
\protect\hyperlink{page.\insertframenumber}
So the full code is:
\addtobeamertemplate{frametitle}{}{%
\ifframeinlbf
\addcontentsline{lbf}{section}{\protect\makebox[2em][l]{%
\protect\usebeamercolor[fg]{structure}\insertframenumber\hfill}%
\protect\hyperlink{page.\insertframenumber}\insertframetitle\par}%
\else\fi
}
The above requires the hyperref package, so make sure you include it.
The answer of Sandro shows a very useful addition to Gonzalo Medinas answer in case one actually wants to use the list of frames as a link collection to easy access a certain frame.
However, the solution of Sandro fails if one resets the frame counter during the presentation. This is a more robust approach which also consideres overlays to avoid multiple links of the same frame:
\addtobeamertemplate{frametitle}{}{%
\only<1>{%
\hypertarget{\insertframetitle}{}%
\addcontentsline{lbf}{section}{\protect\makebox[2em][l]{%
\protect\usebeamercolor[fg]{structure}\insertframenumber\hfill}%
\protect\hyperlink{\insertframetitle}{\insertframetitle}\par}%
}%
}
\frametitle[linktitle]{${\mathbb {R}}$}?
– Robert Seifert
Sep 24 '20 at 17:36
\contentsline {section}{\makebox [2em][l]{\usebeamercolor [fg]{structure}5\hfill }\hyperlink {{${\mathbb {R}}$}}{{${\mathbb {R}}$}}\par } inside the *.lbf file.
– Dmitri Zaitsev
Sep 25 '20 at 12:50
i want to add some comments to the solution of Sandro:
The code was not working for me until i changed the line
\addcontentsline{lbf}{section}{\protect\makebox[2em][l]{%
to
\addcontentsline{lbf\thesection}{section}{\protect\makebox[2em][l]{%
Further, the idea with the link is good, but if you have uncover-effects, e.g. with pause, uncover, ..., the framenumber does not correspond with the page number. Thus i changed the line
\protect\hyperlink{page.\insertframenumber}\insertframetitle\par}%
to
\protect\hyperlink{page.\insertpagenumber}\insertframetitle\par}%
Hope i was able to contriubte something!