I want to write the name of a equation next to it instead of a number. I followed the structure of the first answer given in Add equation name underneath equation number . But it seems that links turn wrong.
Changing a bit the answer given, here you have MWE:
\documentclass{article}
\usepackage{amsmath}
\newcommand{\eqname}[1]{\tag*{#1}}% Tag equation with name
\usepackage{hyperref}
\begin{document}
\begin{equation} \label{f}
f(x) = a \eqname{(Constant)}
\end{equation}
\begin{equation} \label{g}
g(x) = ax
\end{equation}
See \eqref{f} and \eqref{g}.
\end{document}
Now, \eqref{f} appears as (Constant) and \eqref{g} as (1), but by clicking in both links the document goes to the first equation, the one named Constant. I cannot go to the second equation clicking in its reference, (1) .
What should I do to fix this? Thanks in advance.