# How can change an equation number according to where it is mentioned for the first time?

I am writing 2 long equations in the top of a page in a paper. For paper construction and presentation purposes, I want to write the both in one place (so their code are brought together using Figure environment). The problem is that the second one will be introduced one page later and I want its number adjusted according to the place I mention it for the first time, not the place of it in the code. Is this possible? (For clarification, first equation number is 35, then I have to bring 5 equations to obtain the second formula whose number should be 41, but now it is 36 and those 5 equations required to obtain second one is numbered after that.) When I use \tag, latex automatically assign it again to another equation later.

• it's rather unusual to float equations, but for any numbered construct it is best to make them all float or non float. If you mix then as you find, the floating ones can float past the non floating ones. – David Carlisle Jan 14 at 18:15
• it's rather unusual to float equations, but for any numbered construct it is best to make them all float or non float. If you mix then as you find, the floating ones can float past the non floating ones. – David Carlisle Jan 14 at 18:15

If you want the equation number to come from a specific location, you can use \refstepcounter{equation}\label{...} at the location and \tag{\ref{...}} in the float.

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum}% MWE only

\begin{document}
\begin{figure}[b]% just to force a delay
$$x=b \tag{\ref{mary}}$$
\end{figure}

Given
$$x=a$$
and
$$a=b$$
we can obtain the equation on the bottom of the page.%
\refstepcounter{equation}\label{mary}

\lipsum[1-8]
\end{document}

• Add % after the page. Murphy's law is always ready to strike. – egreg Jan 14 at 17:24
• @egreg - Why there? – John Kormylo Jan 14 at 17:32
• Mhhh... possible pagebreak there and so \pageref{mary} will point to the next page? (Guessing...) @egreg – Rmano Jan 14 at 17:49
• @Rmano Yes, the space after “the page." would not be removed, maybe leading to a line that has to be broken and the float pushed one page further… – egreg Jan 14 at 17:59
• Thanks a lot @JohnKormylo Kormylo. Great. It worked. – Masoud Arash Jan 15 at 9:08