Hi all The following bug has the potential to destroy a lot of cross-references of a document if one is not aware that lyx shows something different than it does. My Bug-description has three parts. If you don't consider the first as bug, then look also at the second which is more apparently a bug and is based on the first.
1. Probably you know about the behavior described in part 1. and perhaps even want it, but for a user who does not see what is going on inside lyx, it clearly looks like a bug. And this misunderstanding can lead to messing up your references): * Open new document * Insert equation in displaymode with <alt>-m-d and insert (<alt>-i-l) the label "test" * Below insert a reference to this label via <alt>-i-r * A test compile shows that the reference correctly refers to (1) * Now copy the display equation from above and paste it below the reference. * The new equation carries the label "DUPLICATE:test", while the reference within lyx still refers to "test", so one should expect that the same happens after compilation. * However, if you compile, the reference refers to (2)! Apparently lyx doesn't really give the copied equation the label "DUPLICATE:test", but internally still uses the label "test" (why?). Also, if one pastes the copied equation above the original one, the original one get's the label DUPLICATE... . For usual purposes I think that it is more natural if always the copied equation is called the DUPLICATE and the corresponding label is really changed. If a user desperately wants to call to equations the same, he could then still manually change it back. The alternative is to not give the impression that the label has really been changed, although it has not. 2. Now comes the fun part: The lyx-reference which still is called "test" is bound to the labels of both equations!! * go to the first equation and change the label to "tes". The lyx-reference will likewise change to "tes". But when you compile it, it shows a broken reference! * undo the change of the label name with ctrl-z and go to the second equation and change the label name from "DUPLICATE:test" to "DUPLICATE:tes". Only now the lyx reference shows that it is also bound to the second equation and shows that it refers to "DUPLICATE:tes". But also now after compilation you have a broken reference! 3. Undo again the label changes and copy the second equation (the DUPLICATE-one) and paste it directly below, such that you have two duplicates. If you compile now, the reference in the dvi will refer to (3), which is expected from what we have seen so far. However, if you know delete the third equation again and compile again, the reference is still refering to (3),although there are only equations (1) and (2)! Apparently, for this bug lyx is running latex not enough frequently to get the references right. Also manually compiling again (ctrl-shift d) does not help. You have to make some other change in the document to get the reference right again. - Sebastian