I am following the solution in How to additionally name equations in align environment? to name my own equations. I would now like to align them at the =
sign and the text where
, but I am not getting it right.
\documentclass{article}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{amsmath}
\begin{document}
\begin{flalign}
\phantom{(\mathrm{elf})\ (2)} && % balance out width of descriptor
\alpha_i^t &= asd \quad\text{where}\quad i \in [1,...,n]
&&
(\mathrm{elf})\label{eq:attentionhead1}\\
\phantom{(\mathrm{elf})\ (2)} && % balance out width of descriptor
\alpha_i^t &= g\Bigl(\frac{u}{v}\Bigr) \quad\text{where}\quad i \in [1,...,n]
&&
(\mathrm{clf})\label{eq:attentionhead2}
%\label{eq:attentionhead1}
\end{flalign}
\ref{eq:attentionhead1} \ref{eq:attentionhead2}
\end{document}
I tried to follow the solution in Aligning equations with text with alignat equations-with-text-with-alignat, but it did not work.
\begin{flalignat*}{3}
...
\end{flalignat*}{3}