1

All pages are printed. How to solve it?

\documentclass{beamer}
\includeonlyframes{current}
\usetheme{Berlin}
\usepackage[]{graphicx}
\usepackage[backend=bibtex,style=authoryear]{biblatex}
\usepackage[absolute,overlay]{textpos}
\addbibresource{ppgeq.bib}

\begin{document}
\begin{frame}[label=current]
  Slide 1
\end{frame}
\begin{frame}
  Slide 2

\begin{textblock*}{5cm}(9cm,2.5cm) % {block width} (coords)
\includegraphics[width=3cm]{image.png}
\end{textblock*}
\end{frame}
\end{document}
1

Give the frame containing your textblock a label that is not used as part of your \includeonlyframes list:

\documentclass{beamer}

\includeonlyframes{current}
\usepackage[absolute,overlay]{textpos}

\begin{document}

\begin{frame}[label=current]
  Slide 1
\end{frame}

\begin{frame}[label=notcurrent]
  Slide 2

  \begin{textblock*}{5cm}(9cm,2.5cm) % {block width} (coords)
  \includegraphics[width=3cm]{example-image}
  \end{textblock*}
\end{frame}

\end{document}

The above produces a single frame (Slide 1).


The following etoolbox patch provides a default (unique) label to each frame, which can be overwritten using the label=<label> key. This way \includeonlyframes still works as expected:

\usepackage{etoolbox}
\makeatletter
\patchcmd{\beamer@@@@frame}% <cmd>
  {\setkeys{beamerframe}{#2}}% <search>
  {\edef\theframe{\number\numexpr\value{framenumber}+1}%
   \setkeys{beamerframe}{label=frame-\theframe,#2}}% <replace>
  {}{}% <success><failure>
\makeatother
  • So how to give a default label? I have many slides... – Vitor Abella Jun 22 '16 at 5:57
  • 1
    @Vitor: See the updated answer. – Werner Jun 22 '16 at 6:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.