# IEEEeqnarray + Hyperref -> reference jumps to the beginning of the document

This is a problem concerning \IEEEeqnarray, \IEEEyessubnumber, and \eqref in combination with hyperref.sty.

\documentclass{article}
\usepackage{amsmath}
\usepackage{IEEEtrantools}
\usepackage{hyperref}
\begin{document}
page1\newpage
\phantomsection\begin{IEEEeqnarray}{rCl}
\IEEEyesnumber\label{eqn} \IEEEyessubnumber*
a &=&b \label{subeqn}\\
&=&c
\end{IEEEeqnarray}
clicking \eqref{subeqn} sends me to the correct position :)\\
clicking \eqref{eqn} sends me to the beginning of the document :(
\end{document}


Problem
Clicking on (1) sends me to the beginning of the document, instead of to Equation (1).

Related questions
"IEEEeqnarray vs. hyperref -> reference jumps to the beginning of the section "
I think it is not a duplicate as the solution therein, namely adding \phantomsection as in the MWE, has no effect.

I use IEEEtrantools 2015/08/26 V1.5 by Michael Shell.

• what is so special on IEEEeqnarray, that you use it? you load amsmath and with it you can use align inside subequations and all will work as expected ... – Zarko Aug 20 '18 at 13:41
• this document even more convinced me, that amsmath environments are superior to result of the IEEEeqnarray. however, with way as i suggested you before, links will work as expected. – Zarko Aug 20 '18 at 14:04
• @Zarko see Section 4.1 moser-isi.ethz.ch/docs/typeset_equations.pdf I'd prefer if we leave it to that instead of trailing off topic ;) – Felix Aug 20 '18 at 14:30
• Sorry, but I couldn't agree less with the reference you link. The fact that the author suggests using some sort of \hspace which (I quote) "will never yield a precise arrangement" simply means the author does not know how to use align. – campa Aug 20 '18 at 14:30
• Don't misunderstand me, I have nothing against IEEE. It seems a valid alternative. But all alleged flaws of amsmath are just ignorance of the author. Which syntax is more convenient might well be a matter of taste. – campa Aug 21 '18 at 18:58

IEEEeqnaray uses \stepcounter{equation} instead of \refstecounter{equation}, then sets \@currentlabel and \@currentHref directly. \IEEEyesnumber just sets a flag for later use.

The group containing \label{eqn} can be inserted almost anywhere. It is a sort of \pseudoequation command.

\documentclass{article}
\usepackage{amsmath}
\usepackage{IEEEtrantools}
\usepackage{hyperref}

\begin{document}
page1\newpage

\begin{IEEEeqnarray}{rCl}

• Thank you John - it works! I've saved myself some adaption time by just redefining \IEEEeqnarray accordingly, i.e., I add to the preamble \let\oldIEEEyesnumber\IEEEyesnumber \renewcommand{\IEEEyesnumber}[0]{{\addtocounter{equation}{-1}\refstepcounter{equation}}\oldIEEEyesnumber} – Felix Aug 20 '18 at 14:58
• Thank you again John! \newcommand{\eqlabel}[1]{\addtocounter{equation}{-1}\refstepcounter{equation}\label{#1}} – Felix Aug 21 '18 at 7:20