Question

My documents often contain "fully restricted" frames of this form:

\begin{frame}<0>
    Lorem ipsum dolor.
\end{frame}

Because of the <0> at the end of the first line, frames like this do not appear in the documents that I produce with pdflatex or xelatex. But they still cause the framenumber counter to increment, which leads to strange results. Here is an example:

\documentclass[xelatex]{beamer}
\begin{document}
  \setbeamertemplate{footline}{\hfill\insertframenumber}
  \begin{frame}<0>{Frame A}
  \end{frame}

  \begin{frame}{Frame B}
  \end{frame}

\end{document}

When I process this document with xelatex, I get a PDF document containing one frame. The framenumber in the footline of the frame is 2. I would like it to be 1. I could manually reset the frame counter after every restricted frame, but in large documents with many such frames, that is a hassle. Is there any way to stop restricted frames from incrementing the counter?

Was it helpful?

Solution

You could create a new environment macro that contains the counter fix:

\newenvironment{restrictedframe}[1]
  {\begin{frame}<0>{#1}}
  {\end{frame} \addtocounter{framenumber}{-1}}

OTHER TIPS

Use only in the mode specification:

\begin{frame}<only@0>{Frame A}
\end{frame}

Then it will be completely ignored and the frame counter won't be incremented.

BTW, you can find an entire community on the TeX StackExchange, where no TeX-related question is too small. There are oodles of beamer questions.

The frames can be excluded from the frame counter by using the noframenumbering option:

\documentclass{beamer}

\setbeamertemplate{footline}[frame number]

\begin{document}

  \begin{frame}<0>[noframenumbering]{Frame A}
  \end{frame}

  \begin{frame}{Frame B}
  \end{frame}

\end{document}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top