1

In the following example, I have a hyperlink that only appears after a \pause, or on \onslide, etc. However, the clickable hyperlink region is active even when the hyperlink text itself is hidden (i.e. we can click the empty region where the hyperlink text will appear even on the very first slide). I would like the hyperlink only to be clickable when it is visible. I also do not want to have to manually annotate hyperlinks with the slide on which they should appear, e.g. explicitly writing <2>. Is this possible?

\documentclass{beamer}

\begin{document}

\begin{frame}{First frame} The hyperlink only appears...

\onslide&lt;2-&gt;{...after a pause. Then we can click \ref{def}.} This text...

...and this text should always be visible.

\end{frame}

\begin{frame}{Second frame} \begin{definition} \label{def} Here is a definition. \end{definition} \end{frame}

\end{document}

A screenshot of the issue (the pointer is over the hyperlink region): an active invisible hyperlink

varkor
  • 539
  • 2
  • 12

2 Answers2

1

If you use \pause the content is still present on the first overlay, just not visible.

If you want something to not be present, you can use \only. To avoid hard coding overlay numbers, you can use relative overlays:

\documentclass{beamer}

%\setbeamercovered{transparent}

\begin{document}

\begin{frame}{First frame} The hyperlink only appears...\pause

...after a pause. Then we can click \only&lt;.(1)-&gt;{\ref{def}}.

\end{frame}

\begin{frame}{Second frame} \begin{definition} \label{def} Here is a definition. \end{definition} \end{frame}

\end{document}

Or \alt if the link should still occupy space:

\documentclass{beamer}

%\setbeamercovered{transparent}

\begin{document}

\begin{frame} \frametitle{First frame} The hyperlink only appears...

\uncover&lt;+(1)-&gt;{...after a pause. Then we can click \alt&lt;-.&gt;{\phantom{\ref{def}}}{\ref{def}}.} This text...

...and this text should always be visible.

\end{frame}

\begin{frame} \frametitle{Second frame} \begin{definition} \label{def} Here is a definition. \end{definition} \end{frame}

\end{document}

0

Different approach: based on this idea by @Werner https://tex.stackexchange.com/a/183357/36296 you could temporarily disable hyperlinks:

\documentclass{beamer}

\setbeamercovered{transparent}

\makeatletter \newcommand{\hyperoff}{\let\hyperlink@secondoftwo} \makeatother

\begin{document}

\begin{frame} \frametitle{First frame} The hyperlink only appears...

\uncover&lt;+(1)-&gt;{% 
  \begingroup%
  \only&lt;-.&gt;{\hyperoff}%
  ...after a pause. Then we can click \ref{def}.%
  \endgroup%
} This text...

...and this text should always be visible. \ref{def}

\end{frame}

\begin{frame} \frametitle{Second frame} \begin{definition} \label{def} Here is a definition. \end{definition} \end{frame}

\end{document}