# How to “\includeonlyframes” for a Beamer presentation, without counting the skipped pages' numbers?

When I give a presentation, I don't really like to cause my audience undue stress before I even start. However, my presentation currently has the label "1/125" on the bottom corner of my first frame! I am using \includeonlyframes, and the second frame is "16/125", and on.

How can I get beamer to number the presentation based on the actual frames that are used? \includeonlyframes is great for drafts, but what if I want to pull frames from a few different collections, kept in separate .tex documents, only keeping some from each? Of course, with appropriate page numbering in the final draft.

\RequirePackage{filecontents}
\begin{filecontents}{topic_1_frame_pool.tex}
\begin{frame}[label=one]
\frametitle{<slide title>}
\end{frame}

\begin{frame}[label=two]
\frametitle{<slide title>}
\end{frame}
\end{filecontents}

\begin{filecontents}{topic_2_frame_pool.tex}
\begin{frame}[label=three]
\frametitle{<slide title>}
\end{frame}

\begin{frame}[label=four]
\frametitle{<slide title>}
\end{frame}

\begin{frame}[label=five]
\frametitle{<slide title>}
\end{frame}

\begin{frame}[label=six]
\frametitle{<slide title>}
\end{frame}
\end{filecontents}

\documentclass[utf8]{beamer}
\mode<presentation>

\includeonlyframes{one,three,five}

\begin{document}

\input{topic_1_frame_pool}
\input{topic_2_frame_pool}

\mode
<all>
\end{document}

• What is the purpose of the frames you never show? The use of \includeonlyframes is intended to be similar, as I understand it, to \includeonly. The idea is that when working on a small part of the document, you can just compile that rather than the whole thing, and you'll still get the references and page numbers and so on as they should be. It isn't intended for cases where your final document will only consist of, say, the first and third included files. It is intended for cases where you temporarily want to just compile the first and third files because you are working on those. – cfr Nov 26 '15 at 21:10
• So, yes, the numbering is a feature. But it is not intended for use in the output you finally show an audience. – cfr Nov 26 '15 at 21:12
• @cfr I give different talks based on my audiences, and I use \input to draw from a pool of pools of frames, then \includeonlyframes to pick the ones I want for a particular talk. Maybe there is a better workflow, but my life would be easier if I didn't have to learn one :) – repurposer Nov 26 '15 at 21:16
• Well you are trying to use a feature for something it is not designed to do and are therefore finding that the feature doesn't work well for your purposes. I don't think it is at all wise to use it this way but, if you insist, you can obviously do so. In that case, don't put the frame numbers on the slide so that there will be nothing to scare your audience off. The right way to do this would be to conditionally include stuff in a way which is not based on a feature not designed for use in the final version of the document. – cfr Nov 26 '15 at 21:23
• I'm not clear what you mean by drawing from a 'pool of pools of frames' but, if you don't want to use an alternative strategy, it probably don't matter much what you mean. If you do want an alternative, you'd need to edit your question to better reflect how you are currently doing things so that people can suggest alternative solutions. But it doesn't sound as though that is really an issue here. The easy solution is just not to put the numbers in the slides. – cfr Nov 26 '15 at 21:29

As long as you are not using overlays, you could elude the problem by using page numbers instead.

\RequirePackage{filecontents}
\begin{filecontents}{topic_1_frame_pool.tex}
\begin{frame}[label=one]
\frametitle{<slide title>}
\end{frame}

\begin{frame}[label=two]
\frametitle{<slide title>}
\end{frame}
\end{filecontents}

\begin{filecontents}{topic_2_frame_pool.tex}
\begin{frame}[label=three]
\frametitle{<slide title>}
\end{frame}

\begin{frame}[label=four]
\frametitle{<slide title>}
\end{frame}

\begin{frame}[label=five]
\frametitle{<slide title>}
\end{frame}

\begin{frame}[label=six]
\frametitle{<slide title>}
\end{frame}
\end{filecontents}

\documentclass[utf8]{beamer}
\mode<presentation>

\includeonlyframes{one,three,five}

\usepackage{lastpage}

\makeatletter
\setbeamertemplate{footline}{%
\leavevmode%
\hbox{%
\end{beamercolorbox}%
\end{beamercolorbox}%
\thepage~/~\pageref{LastPage}\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother

\begin{document}

\input{topic_1_frame_pool}
\input{topic_2_frame_pool}

\mode
<all>
\end{document}