When using the \labelrel command (with \overset instead of \stackrel as \stackrel is obsolete: Differences between \stackrel and \stackbin) from @Circumscribe Put reference above equal sign and refer to it in an align-environment the alignment is not correct:
\documentclass{article}
\usepackage{mathtools}
\newcounter{relctr} %% <- counter for relations
\renewcommand*\therelctr{\alph{relctr}} %% <- label format
\newcommand\labelrel[2]{%
\begingroup
\refstepcounter{relctr}%
\overset{\textnormal{(\alph{relctr})}}{\mathstrut{#1}}%
\originallabel{#2}%
\endgroup
}
\AtBeginDocument{\let\originallabel\label} %% <- store original definition
\begin{document}
\begin{align*}
a &= b \\
&\labelrel{=}{someLabel} c
\end{align*}
\end{document}
This seems to be a well known problem with the \overset command: \overset and align environment: how to get correct alignment? where the aligned-overset package offers a nice solution.
So my question is how one can achieve similar behavior for the \labelrel command or even more generally specify the behavior with align for new commands.
I don't have any experience with coding new commands myself but I decided to post this as a new questions as this may be an interesting question for other users as well.
Here is what I tried:
Search the internet
Try using the aligned-overset in the definition of
\labelrelbut I had no idea on how to pass the & fromalignto the definitionLook at the implementation of aligned-overset to copy the relevant code however I almost didn't understand anything.


