
Escribo algunas ecuaciones en el proyector y quiero señalarlas mediante el hipervínculo, pero el vínculo producido por el comando hyperref[label]{text}
en el paquete hyperref
no apunta al lugar correcto mientras que el \ref
comando apunta al lugar correcto. Por ejemplo
\documentclass{beamer}
\hypersetup{
colorlinks,
linkcolor=red,
}
\begin{document}
\begin{frame}[c]\frametitle{page 1}
\begin{equation}\label{eq:1}
123
\end{equation}
\end{frame}
\begin{frame}[c]\frametitle{page 2}
\begin{equation}\label{eq:2}
456
\end{equation}
\end{frame}
\begin{frame}[c]\frametitle{page 3}
Right link, will point to page 2:\ref{eq:2}\par
Wrong link, doesn't point to page 2:\hyperref[eq:2]{The equation 2}\par
\end{frame}
\end{document}
Lo uso xelatex
como compilador y la plataforma es TL2016 y Windows 7.
Respuesta1
En lugar de \hyperref[]{}
usar \hyperlink{}{}
-- \hyperlink
se redefine beamer
para usar lo habitual \ref
internamente, ya que ese comando usa enlaces de forma predeterminada (con hyperref
) y el enlace funcionará, pero fallaría en otro documento configurado con otra clase de documento ya que \hyperlink
aplica el nombre del ancla y no el nombre de la etiqueta.
También tenga en cuenta que también \hyperlink
admite la <>
sintaxis de superposición de diapositivas.beamer
\documentclass{beamer}
\hypersetup{
colorlinks,
linkcolor=red,
}
\begin{document}
\begin{frame}[c]\frametitle{page 1}
\begin{equation}\label{eq:1}
123
\end{equation}
\end{frame}
\begin{frame}[c]\frametitle{page 2}
\begin{equation}\label{eq:2}
456
\end{equation}
\end{frame}
\begin{frame}[c]\frametitle{page 3}
Right link, will point to page 2:\ref{eq:2}
Correct link, does point to page 2:\hyperlink{eq:2}{The equation 2} as well!
\end{frame}
\end{document}