Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
\usepackage[xetex, colorlinks=true, citecolor=blue, linkcolor=blue]{hyperref}

\begin{document}

\begin{equation}
    a = b \label{eq} \tag{$\ast$}
\end{equation}

\[ \eqref{eq} \] % working hyperlink here.

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

\end{document}

Any help is greatly appreciated!

share|improve this question
1  
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! –  simon 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
2  
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
2  
$ c = a \overset{\mbox{\scriptsize\eqref{eq}}}{=} b $ works. –  user700902 Feb 26 '13 at 8:21

1 Answer 1

up vote 1 down vote accepted

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

\documentclass[a4paper, 12pt]{article}
\usepackage{amsmath}
\usepackage[xetex, colorlinks=true, linkcolor=blue]{hyperref}

\begin{document}

\begin{equation}
    a = b \label{eq} \tag{$\ast$}
\end{equation}

\[ c  = a \overset{\mbox{\scriptsize\eqref{eq}}}{=} b\] % thanks user700902 

\end{document}

I however chose to use LuaLaTeX, which didn't require any change of the source code.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.