beamer: not incrementing framenumber for "fully restricted" frames
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 xela开发者_运维问答tex, 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?
Beamer now automatically excludes frames which are hidden with <0>
from increasing the frame counter. So the solution is now increadible easy:
do nothing :)
\documentclass{beamer}
\setbeamertemplate{footline}[frame number]
\begin{document}
\begin{frame}<0>
\frametitle{Frame A}
\end{frame}
\begin{frame}
\frametitle{Frame B}
\end{frame}
\end{document}
Pre-v3.65 solution:
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]
\frametitle{Frame A}
\end{frame}
\begin{frame}
\frametitle{Frame B}
\end{frame}
\end{document}
You could create a new environment macro that contains the counter fix:
\newenvironment{restrictedframe}[1]
{\begin{frame}<0>{#1}}
{\end{frame} \addtocounter{framenumber}{-1}}
精彩评论