4

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}
\hypersetup{hidelinks}
\usepackage{type1ec}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}

\begin{document}

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

\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
  • 1
    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
  • 1
    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
4

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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