# IEEEeqnarray vs. hyperref -> reference jumps to the beginning of the section

I'm using the package IEEEtrantools in an scrreprt document class environment. My problem is that, when using IEEEeqnarray together with hyperref, the link jumps to the beginning of the section and not to the referred equation. How can I make the link jumping to the equation?

Example:

\documentclass{scrreprt}
\usepackage[retainorgcmds]{IEEEtrantools}
\usepackage{hyperref}

\begin{document}
\section{The equation}
\newpage
\begin{IEEEeqnarray}{c}
\frac{1}{v(E)}\frac{\partial}{\partial t}\Psi(\mathbf{r},\mathbf{\Omega},E,t)
+ \mathbf{\Omega} \cdot \nabla \Psi(\mathbf{r},\mathbf{\Omega},E,t)
+ \Sigma_t(\mathbf{r},E,t) \Psi(\mathbf{r},\mathbf{\Omega},E,t)
= S(\mathbf{r},\mathbf{\Omega},E,t)
\IEEEeqnarraynumspace
\label{eq:Boltzmann}
\end{IEEEeqnarray}
\newpage
Referencing (\ref{eq:Boltzmann})...
\end{document}
-
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). –  Stephen Jan 17 '12 at 9:05

Just add a \phantomsection before \begin{IEEEeqnarray}{c}. While the appearance in print/pdf will be unchanged, hyperref will link/jump there instead of the (real) \section above.

Already seeing your next question "For each IEEEeqnarray?!", you could also use

\usepackage{etoolbox}
\AtBeginEnvironment{IEEEeqnarray}{\phantomsection}

after \usepackage{hyperref}. In that case you do not need to manually set the \phantomsections. (And you might want to send a bug report to the hyperref maintainer, Heiko Oberdiek, who generally is very helpful.)

As last remark: In principle the \phantomsection would belong directly before \label{eq:Boltzmann}. If you have an IEEEeqnarray with more than one \label inside, the hyperlinks would otherwise always aim at the beginning of the environment (instead of the line with the labelled equation). Therefore you could also instead declare (after \usepackage{hyperref})

\newcommand{\plabel}[1]{\phantomsection \label{#1}}

and use \plabel instead of \label inside the IEEEeqnarray environment.

-
Great! Thank you. –  Yaraay Jan 20 '12 at 10:38
@Yaraay: My pleasure! Just for information: When you think an answer is useful, you can upvote it by clicking the upwards "arrow" on the left of the answer over the number given the current upvotes (when there is more than one answer to an question, more than one can be upvoted), and for answers to your own question you can accept one of the answers by clicking at the checkmark which is placed a little bit lower. (This gives reputation to the person who gave the answer as well as to yourself.) –  Stephen Jan 20 '12 at 19:23

Version 1.8 of IEEEtran.cls (and version 1.3 of IEEEtrantools.sty) now fixes the problem with hyperref under IEEEeqnarray. Enjoy!

-