I'm using the stackrel command to indicate important steps in the transformation of formulas. E.g. I would write: A\stackrel{(!)}{=}B so that I can later explain in text why exactly A equals B.
I've written a command \refeq{foo} now that will do this for me. So that I can use \eqqref{foo} later in text and it will automatically show the right number for the right equals sing in text (same as using \label{foo} and ref{foo}).
I only have one problem: when I have an equation that I want to label; and within this equation is also an equals sign that I want to reference to, I get the error
Package amsmath Error: Multiple \label's: label 'rom' will be lost.
what should I do to overcome this? I want to be able to ref to an equation and to any equals sign inside this equation.
Here's my working copy:
\documentclass{article}
\usepackage{hyperref}
\usepackage{amsmath}
\def\clap#1{\hbox to 0pt{\hss#1\hss}}
\def\mathllap{\mathpalette\mathllapinternal} \def\mathrlap{\mathpalette\mathrlapinternal} \def\mathclap{\mathpalette\mathclapinternal}
\def\mathllapinternal#1#2{\llap{$\mathsurround=0pt#1{#2}$}}
\def\mathrlapinternal#1#2{\rlap{$\mathsurround=0pt#1{#2}$}}
\def\mathclapinternal#1#2{\clap{$\mathsurround=0pt#1{#2}$}}
\newcounter{qc}
\setcounter{qc}{2}
\usepackage{refcount,makerobust}
\newcommand{\refeq}[1]{%
\refstepcounter{qc}\label{#1}%
\stackrel{
\stackrel{
{\text{\tiny $\mathclap{\roman{qc}}$}}
}{\text{$\downarrow$}}
}{=}%
}
\newcounter{refeqc}
\setcounter{refeqc}{0}
\newcommand{\eqqref}[1]{%
\setcounterref{refeqc}{#1}%
$(\roman{refeqc})$
}
\begin{document}
\begin{equation}A\refeq{AB}B\label{romeo} \end{equation}
\begin{equation}R=B\refeq{BC} C\end{equation}
\eqqref{AB} in equation \ref{romeo} is the same as \eqqref{BC}
\end{document}
Any help on what to do would be great!
I've tried using protect and mbox, but nothing works!