I'm currently working on a documentation for a big project that is an extension of an existing one, and I'm looking for the solution of a problem that can be troublesome for the sustainability of the code.
For the previous project, we had comments inside the code such as "// Equation 26 in annexe B of Documentation-VersionX" which allowed us to check the theory behind functions inside the code, and to verify if the function corresponded to the equation. However, as you can imagine, things get troublesome if we insert a new equation in the model as all equation after this one will not be referenced correctly afterwards (old references to "Equation 26" would need to become "Equation 27").
I've been thinking about a way to create a refrence for each equation that would be independant of other equations, but it wouldn't be good to read a documentation and have equation label/numbers not following the classic order. This means that the reference in the documentation has to be like before ("Equation 17" needs to be the 17th equation in the paper), so I need to fix an unchanging-number for each equation inside the LaTeX code which is referenced inside the JAVA code of the project. This unchanging-reference could then be paired with the "true" reference for this equation inside the PDF.
Parsing Java file and changing unchanging references to a pair of (unchanging reference, PDF number reference) is something that I can manage, but I don't know how to extract automatically those PDF references that are generated by LaTeX, and pair them with their unchanging references inside an output file.
I'm sorry if this question isn't very clear, I had trouble finding similar problems on SE or Google. I don't have a lot of experience with advanced LaTeX tasks like this, and the only way to do this outside LaTeX would be to parse the .tex file for each equation label, order them in the pdf order, and parse the Java code to insert the true PDF reference. This way seems kinda barbaric, so I'm looking for another way to do this if possible.
Edit : To clarify my question : I would like to find a way to create unchanging references to my equation (like labels), and pair them with their actual number in the PDF (example : Equation 25, which is referenced a Q_eval_2 in the .tex) in an output file. With this output file I could manage to create, artificially, the cross-referencing that I'm looking for.