You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A while ago in issue 750 I wrote that cleverref and beamer do not work together well, but also found a sort of fix.
Now I am facing the same problem with autoref and nameref. I attach a minimal example and would appreciate any advice
\documentclass{beamer}
\usepackage[spanish]{babel}
\makeatletter
\Hy@AtBeginDocument{%
\def\@pdfborder{0 0 1}% Overrides border definition set with colorlinks=true
\def\@pdfborderstyle{/S/U/W 1}% Overrides border style set with colorlinks=true
% Hyperlink border style will be underline of width 1pt
}
\makeatother
\hypersetup{%
colorlinks=true,% hyperlinks will be coloured
% linkcolor=blue,% hyperlink text will be blue
urlcolor=blue,% hyperlink text will be blue
% linkbordercolor=red,% hyperlink border will be red
urlbordercolor=red,% hyperlink border will be red
}
\usepackage{nameref}
\usepackage{thmtools}
\newtheorem{thm}{Theorem}
\begin{document}
\begin{frame}
\frametitle{Equations are here}
this is important
\begin{equation}
\label{eq:beamer-auto-nameref:1}
\int f dx =0
\end{equation}
\end{frame}
\begin{frame}
\frametitle{Reference with autoref}
this is \autoref{eq:beamer-auto-nameref:1}
But using eqref \eqref{eq:beamer-auto-nameref:1}
\end{frame}
\begin{frame}
\frametitle{Now a theorem}
\begin{thm}[Riemann's Hypothesis]
\label{thr:beamer-auto-nameref:1}
Let
\end{thm}
\end{frame}
\begin{frame}
\frametitle{Reference to the theorem}
\ref{thr:beamer-auto-nameref:1}
Consider \autoref{thr:beamer-auto-nameref:1}
And \nameref{thr:beamer-auto-nameref:1}
\end{frame}
\end{document}
I found a solution for the required functionality but it relies on cleveref, any comments are welcome.
regards
Uwe Brauer
\documentclass{beamer}
\hypersetup{colorlinks=true}
\usepackage{nameref}
\newtheorem{thm}{Theorem}
\usepackage{cleveref}
\Crefname{thm}{Theorem}{Theorems}
% fix for cleverref
\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.
%
\newcommand*{\fullcleveref}[1]{%
\hyperref[{#1}]{\Cref{#1} (\nameref*{#1})}%
}
\newcommand*{\hypercleveref}[1]{%
\hyperref[{#1}]{\Cref{#1}}%
}
\begin{document}
\begin{frame}
\frametitle{Equations are here}
this is important
\begin{equation}
\label{eq:beamer-auto-nameref:1}
\int f dx =0
\end{equation}
\end{frame}
\begin{frame}
\frametitle{Now a theorem}
\begin{thm}[Riemann's Hypothesis]
\label{thr:beamer-auto-nameref:1}
Let
\end{thm}
\end{frame}
\begin{frame}
\frametitle{Reference to the theorem and the equation}
\hypercleveref{eq:beamer-auto-nameref:1}
\fullcleveref{thr:beamer-auto-nameref:1}
\end{frame}
\end{document}
Hi
A while ago in issue 750 I wrote that
cleverref
and beamer do not work together well, but also found a sort of fix.Now I am facing the same problem with
autoref
andnameref
. I attach a minimal example and would appreciate any adviceand the pdf file
beamer-auto-nameref.pdf
The text was updated successfully, but these errors were encountered: