# [Tex/LaTex] Package amsmath Error: Multiple \label’s

amsmatherrorsoverset

Sorry about the previous errors in the code.

Could any one help with the numbering in the \overset or \underset in equations?

I need to add number above/below certain variables in the equations because I have so many variables. And the equations are very long. I consider to use the counter to auto-number the variables in equations. I tried the following code, but it seems that the \overset and \underset conflicts with the label of equation.

I got the following errors:

Package amsmath Error: Multiple \label's: label 'Eq1' will be lost. Y & = \overset{\dln{aaa}}{\boxed{a}}


\documentclass{article}

\usepackage{amssymb}
\usepackage{amsmath}

\DeclareRobustCommand{\dln}[1]{%

\begin{document}

Here is the equation:\\

\label{Eq1} % I need the Eq. number \begin{aligned} % I need the aligned equation Y & = \overset{\dln{aaa}}{\boxed{a}} x_1 \\ % I need the aaa to be auto numbered & + \underset{2}{\boxed{b}} x_2 % I need the bbb to be auto numbered \end{aligned}

Here is how to refer \dln{aaa}. % I need to refer the number indexed by aaa

\end{document}


This is what I want:

\documentclass{article}

\usepackage{amssymb}
\usepackage{amsmath}

\makeatletter
\def\zzlabel#1{\ifmeasuring@\else\ltx@label{#1}\fi}
\makeatletter

\DeclareRobustCommand{\dln}[1]{%
\label{Eq1} % I need the Eq. number \begin{aligned} % I need the aligned equation Y & = \overset{\dln{aaa}}{\boxed{a}} x_1 \\ % I need the aaa to be auto numbered & + \underset{\dln{bbb}}{\boxed{b}} x_2 % I need the bbb to be auto numbered \end{aligned}