Hi!

I would like a macro which will find the value inside \tag{...} from each of the expression <disp-formula id="deqn*>...</disp-formula>, copy it and paste on deqn* position like deqn5 in the below sample expression 1 and deqn1-3a in case of the sample expression 2.

Sample expression 1:

Sample expression 2:

Keep in mind that there could be any number of \tag{...} in a single expression <disp-formula id="deqn*>...</disp-formula> and the macro will put the values like deqn{first value inside \tag-last value inside \tag} as for example:

should become

And

should become

I would like a macro which will find the value inside \tag{...} from each of the expression <disp-formula id="deqn*>...</disp-formula>, copy it and paste on deqn* position like deqn5 in the below sample expression 1 and deqn1-3a in case of the sample expression 2.

Sample expression 1:

- Code: Select all
`<disp-formula id="deqn*"><text-notation="math">\begin{equation*}`

x+y=5 \tag{5}

\end{equation*}</text-notation="math"></disp-formula>

Sample expression 2:

- Code: Select all
`<disp-formula id="deqn*"><text-notation="math">\begin{align*}`

y=5 \tag{1}\cr

dx+dy=p \tag{3a}

\end{align*}</text-notation="math"></disp-formula>

Keep in mind that there could be any number of \tag{...} in a single expression <disp-formula id="deqn*>...</disp-formula> and the macro will put the values like deqn{first value inside \tag-last value inside \tag} as for example:

- Code: Select all
`<disp-formula id="deqn*"><text-notation="math">\begin{equation*}`

x=5 \tag{5}

y=3 \tag{6}

x+y=8 \tag{7}

\end{equation*}</text-notation="math"></disp-formula>

should become

- Code: Select all
`<disp-formula id="deqn5-7"><text-notation="math">\begin{equation*}`

x=5 \tag{5}

y=3 \tag{6}

x+y=8 \tag{7}

\end{equation*}</text-notation="math"></disp-formula>

And

- Code: Select all
`<disp-formula id="deqn*"><text-notation="math">\begin{equation*}`

x+y=5 \tag{5}

\end{equation*}</text-notation="math"></disp-formula>

should become

- Code: Select all
`<disp-formula id="deqn5"><text-notation="math">\begin{equation*}`

x+y=5 \tag{5}

\end{equation*}</text-notation="math"></disp-formula>