Nicolás wrote:
You are right in that we may have cross-references between children
documents. I still think that my proposal of automatically renaming
labels is a good idea. What you say is actually not a problem is a
little of care is taken by LyX when inserting cros-references.
Imagine we are working in document A and want to insert a reference to
a label "LabelInA" in the same document. Then LyX would introduce the
reference as usual, i.e. \ref{LabelInA}. Now we want to insert a
reference to a label "LabelInB" in same document B. LyX would detect
that the label is in another document (easy, since we have to choose
that document in the cross-references dialog) and introduce the
reference as, e.g., \ref{DocumentB:LabelInB}.
Now, when we include document A in a third document and compile, LyX
would rename all labels of document A (and of all documents, including
the master) by adding a prefix "DocumentA:" and would update the
references (in the same document A) to those lables accordingly (in
our example would change \ref{LabelInA} to \ref{DocumentA:LabelInA}).
Note that the \ref{DocumentB:LabelInB} would not be modified, and that
would not be necessary, since the labels in document B would also be
renamed by adding prefix "DocumentB:" to them.
I actually thing that, with independence of doing what I say or not,
differentiating whether a reference points to a label in the same
document or in another document is wise to facilitate debugging, in
case this is necessary.
Well, one problem I can see is that this could make cut and paste
between documents difficult. And it involves a lot of keeping track of
what's a child of what.
But maybe something like this could be made to work. You're welcome to
bugzilla it.
rh