# hyperref pointing to the wrong equation using subequations

I'm using the following code to write an article, but I'm having some problems cross-referencing the equations with hyperref.

The \eqref{} code returns the right equation's number. But the hyperlinks of the first and second \eqref{} point to equations (1) and (2), and not to correct equations (3a) and (3b), inside the \begin{subequations} ambient. Last \eqref{} instead works correctly. What is wrong with this code?

Thank you for the help.

\documentclass[a4paper,10pt]{article}
\usepackage[a-1b]{pdfx}
\usepackage{type1ec}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}

\begin{document}

$$A=B$$
$$B=C$$
\begin{subequations}
$$C=D \label{eq:1}$$
$$D=E \label{eq:2}$$
\end{subequations}
$$E=F \label{eq:3}$$

\eqref{eq:1} \eqref{eq:2} \eqref{eq:3}

\end{document}

• Welcome to TeX.SX! You don't have to sign with your name since it automatically appears in the lower right corner of your post. – Jesse Dec 12 '14 at 14:21
• i'm not familiar with pdfx, but it presumably takes the place of hyperref. it is, with very few exceptions, necessary for hyperref to be called last. you have pdfx first. – barbara beeton Dec 12 '14 at 14:24
• pdfx does not work on my system, removing it, anding hyperref and placing hyperref + \hypersetup last, then I see no problems with the hyperlink targets. – daleif Dec 12 '14 at 14:24
• Calling pdfx and \hypersetup last works perfectly, thank you very much! – Pacca Dec 12 '14 at 14:30
• @barbarabeeton Wanna make that an answer? – Johannes_B Dec 12 '14 at 16:24

i'm not familiar with pdfx, but it presumably takes the place of hyperref.
it is, with very few exceptions, necessary for hyperref to be called last.
you have pdfx first.