# Is there any way to produce List of frames with beamer?

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?

-
Welcome! What do you want to have as content? Only the frame numbers? –  Marco Daniel May 19 '12 at 16:52
No, frame numbers and titles. –  kryksyh May 19 '12 at 17:08
Or simple itemized list. I guess I can write shell script but wonder if it can be done by latex. –  kryksyh May 19 '12 at 17:37

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

\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

\ifframeinlbf
\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}

-
Thank you! This works perfectly! –  kryksyh May 19 '12 at 20:47
@kryksyh: You're welcome. Don't forget, after a sensible wait, to mark the answer (this one or another one that might eventually appear) that best solved your problem as accepted. In case of doubt, please see How do you accept an answer?. –  Gonzalo Medina May 19 '12 at 20:51
Oh, that faded tick on the left is hard to find first time. Done. Thank you –  kryksyh May 19 '12 at 20:59
Now I have homework - remove from TOC contents slide itself :) –  kryksyh May 19 '12 at 21:09
@SandroGržičić please feel free to open a follow up question, and add there a minimal example document (like the one in my example code) allowing us to reproduce the mentioned problem. –  Gonzalo Medina Jul 25 '13 at 14:06

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
\else\fi
}


The above requires the hyperref package, so make sure you include it.

-

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!

-