1

Related question: Is there any way to produce List of frames with beamer?

Consider the following MWE:

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}

\newif\ifframeinlbf
\frameinlbftrue
\makeatletter
\newcommand\listofframes{\@starttoc{lbf}}
\makeatother

\addtobeamertemplate{frametitle}{}{%
    \ifframeinlbf
    \addcontentsline{lbf}{section}{\protect\makebox[2em][1]{%
        \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{First frame}

\only<1-2>{Água mole em pedra dura \ldots}

\only<2>{\ldots tanto bate até que fura.}

\end{frame}

\begin{frame}

\frametitle{Second frame}

Água mole em pedra dura tanto bate até que fura.

\end{frame}

\end{document}

In the "List of frames" frame the "First frame" appears twice. What could I do to make it appear just once?

Larara
  • 303

1 Answers1

2

Fortunately, there's already plenty of commands for doing things only on certain overlays. This one will create the entries only for overlay 1:

\newcommand\frametocentry{%
    \ifframeinlbf
    \addcontentsline{lbf}{section}{\protect\makebox[2em][1]{%
        \protect\usebeamercolor[fg]{structure}\insertframenumber\hfill}%
    \insertframetitle\par}%
    \else\fi
}

\addtobeamertemplate{frametitle}{}{%
  \only<1>{\frametocentry}
}
  • That worked pretty well! Just one thing: I don't need to start my overlays with \only<2> because of the \only<1>, do I? – Larara Nov 10 '14 at 07:37
  • @Larara: no, you just shouldn't have a \begin{frame}<2-> because that would tell beamer to skip the first frame altogether. (I think.) – Ulrich Schwarz Nov 10 '14 at 07:52
  • let me tell you just one more thing that I think that's strange: the frametitle is not preceded by the frame number as in the example given in the first answer of that related question above... – Larara Nov 10 '14 at 07:58
  • there's something strange, I compiled the .tex again and now it isn't working! – Larara Nov 10 '14 at 09:47