# Clickable hyperlink with \overset and XeLaTeX

I would like my document to have clickable hyperlinks inside \overset environments. I'm using XeLaTeX because of the fonts…

This is a (rather) minimal example:

\documentclass[a4paper, 12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}

\begin{document}

$$a = b \label{eq} \tag{\ast}$$

$\eqref{eq}$ % working hyperlink here.

$c = a \overset{\eqref{eq}}{=} b$ % existing but non-clickable hyperlink here.

\end{document}


Any help is greatly appreciated!

-
Welcome to TeX.SE, and thanks for providing a complete MWE. Interesting that it works fine with pfdLaTeX, but not XeLaTeX. –  Peter Grill Feb 26 '13 at 3:43
@PeterGrill Thanks for pointing that out! I tried to compile my document with LuaLaTeX and amazingly it simply worked and showed the correct hyperlinks! While this doesn't explain the behaviour of XeLaTeX, it's a simpler workaround than I could have dreamed of! Cheers! –  sjakobi Feb 26 '13 at 4:12
If you use (\ref{eq}) rather than \eqref{eq} it will work, even with xelatex –  Ari Brodsky Feb 26 '13 at 4:56
The problem occurs any time you have \text{\ref{eq}} in a math size other than \displaystyle. So in display math mode you need a superscript to produce the problem (\overset implicitly creates a superscript, and \eqref uses the \textup command that unravels to \text), but in inline math the problem occurs without a superscript. –  Ari Brodsky Feb 26 '13 at 7:43
$c = a \overset{\mbox{\scriptsize\eqref{eq}}}{=} b$ works. –  user700902 Feb 26 '13 at 8:21

This is a workaround for XeLaTeX as pointed out by @user700902:

\documentclass[a4paper, 12pt]{article}
\usepackage{amsmath}
$$a = b \label{eq} \tag{\ast}$$
$c = a \overset{\mbox{\scriptsize\eqref{eq}}}{=} b$ % thanks user700902