2

I am trying to hide references in an animateinline environment to show them on click.

MWE:

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{animate}
\usepackage{hyperref}

\begin{document}

 \begin{frame}
  \begin{animateinline}[step]{}
  \parbox[t]{0.8\textwidth}{show reference}
  \newframe
  \parbox[t]{0.8\textwidth}{\ref{sec:test}}
  \end{animateinline}    
 \end{frame}

\section{Test}\label{sec:test}
\begin{frame}
 Test
\end{frame}

\end{document}

Error:

pdfTeX error (ext4): link annotations cannot be inside an XForm \end{frame}

Does anyone know a solution for this?

SLx64
  • 2,823

1 Answers1

2

You cannot not put hyperlinks inside animate frames. The problem is not the reference itself but the fact that hyperref tries to put an hyperlink at the \ref location.

The solution is to enclose the animateinline with \begin{NoHyper}...\end{...} to prevent hyperref from adding a link. More info here: Strange interaction between hyperref, listings and animate

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{animate}
\usepackage{hyperref}

\begin{document}

 \begin{frame}
\begin{NoHyper}
  \begin{animateinline}[step]{}
  \parbox[t]{0.8\textwidth}{show reference}
  \newframe
  \parbox[t]{0.8\textwidth}{\ref{sec:test}}
  \end{animateinline}    
\end{NoHyper}
 \end{frame}

\section{Test}\label{sec:test}
\begin{frame}
 Test
\end{frame}

\end{document}
alfC
  • 14,350