5

I have a problem that i cannot find anywhere else. Consider the MWE below:

\documentclass{beamer}
\usepackage{cleveref}

\begin{document}

\begin{frame}
    \frametitle{toto}
    \begin{equation}
    0 = 1
    \label{titi}
\end{equation}
Wonderfull \cref{titi}, \ref{titi}
\end{frame}

\end{document}

In the pdf beamer output, compiled with pdflatex or latex + dvipdfm, the hyperlink produced by cref in not working (in fact, there is nowhere to click), while the one with ref works fine. If instead of beamer, i use article and load hypperref, both are ok. What am I missing ?

thanks

5

As a bandaid fix you could redefine the \cref command and explictely add the hyperlink, which will give you the desired result.

\documentclass{beamer}
\usepackage{cleveref}

\let\chyperref\cref % Save the orginal command under a new name
\renewcommand{\cref}[1]{\hyperlink{#1}{\chyperref{#1}}} % Redefine the \cref command and explictely add the hyperlink. 

\begin{document}

\begin{frame}
    \frametitle{toto}
    \begin{equation}
    0 = 1
    \label{titi}
    \end{equation}
Wonderfull \cref{titi}, \ref{titi}
\end{frame}

\end{document}
  • What is amazing is that this works. Every \newlabel links to Doc Start. The actual hypertarget names are stored in the snm file and always point to the top of the page. (Beamer is a world unto itself!) – John Kormylo Sep 6 '15 at 19:56
  • thanks! That's awesome. I wonder why I never found this anywhere on internet. There is some mention about label in the cref manual, but that's all, and it was never mentioned that this would cause problem. – Napseis Sep 7 '15 at 8:56

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.