
Escrevo algumas equações no projetor e quero apontar para essas equações usando o hiperlink, mas o link produzido pelo comando hyperref[label]{text}
no pacote hyperref
não aponta para o lugar certo enquanto o \ref
comando aponta para o lugar certo. Por exemplo
\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}
Eu uso xelatex
como compilador e a plataforma é TL2016 e windows 7.
Responder1
Em vez de \hyperref[]{}
usar \hyperlink{}{}
-- \hyperlink
é redefinido beamer
para usar o usual \ref
internamente, já que esse comando usa links por padrão (with hyperref
) e o link funcionará, mas falharia em outro documento configurado com outra classe de documento, pois \hyperlink
aplica o nome da âncora e não o nome do rótulo.
Observe também que também \hyperlink
oferece suporte à <>
sintaxe de sobreposição de slides.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}