Re: Discussion: Labels and parent-child documents

2008-06-03 Thread Abdelrazak Younes

G. Milde wrote:

On  3.06.08, Abdelrazak Younes wrote:

G. Milde wrote:

On  3.06.08, Nicolás wrote:


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.



Not really. Note that labels and cross-references are only updated when
we export to latex.



Does this mean that the labels in child file generated by File>Export>Latex
will differ depending on whether the export is done from the parent or
the child? (Or, maybe,  depending on whether the child was opened
directly or via the parent file? Or whether the parent file is opened
in lyx at the time of the export?)


No, AFAIK labels are not changed at latex export. The one you see within  
LyX are the one really put in the latex file. Just have a look at  
View->source to make sure of that. In 1.6, the DUPLICATE markers are  
only for screen representation, they are of course not exported to LateX.


Not currently. 


However I wanted to highlight a possible complication if the proposal of
expanded labels in parent-child documents is introduced: I would really not
like to behave LyX in such an hardly predictable way. 


I think we all agree then :-)



IMO implementing the parent-child label disambiguation will need carefull
consideration and might be less urgent (or unnecessary) with the
DUPLICATE and BROKEN markers reduce labeling problems in 1.6.


Right. Note also that 1.6 will also avoid duplicates at label _creation_ 
or when portion of text is copied&paste. But LyX won't touch the labels 
of an open document without intervation from the user.


Abdel.



Re: Discussion: Labels and parent-child documents

2008-06-03 Thread G. Milde
On  3.06.08, Abdelrazak Younes wrote:
> G. Milde wrote:
>> On  3.06.08, Nicolás wrote:

 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.

>>> Not really. Note that labels and cross-references are only updated when
>>> we export to latex.

>> Does this mean that the labels in child file generated by File>Export>Latex
>> will differ depending on whether the export is done from the parent or
>> the child? (Or, maybe,  depending on whether the child was opened
>> directly or via the parent file? Or whether the parent file is opened
>> in lyx at the time of the export?)

> No, AFAIK labels are not changed at latex export. The one you see within  
> LyX are the one really put in the latex file. Just have a look at  
> View->source to make sure of that. In 1.6, the DUPLICATE markers are  
> only for screen representation, they are of course not exported to LateX.

Not currently. 

However I wanted to highlight a possible complication if the proposal of
expanded labels in parent-child documents is introduced: I would really not
like to behave LyX in such an hardly predictable way. 

IMO implementing the parent-child label disambiguation will need carefull
consideration and might be less urgent (or unnecessary) with the
DUPLICATE and BROKEN markers reduce labeling problems in 1.6.

Sorry for beeing ambiguous.

Thanks for improving LyX,

Günter


Re: Discussion: Labels and parent-child documents

2008-06-03 Thread Abdelrazak Younes

G. Milde wrote:

On  3.06.08, Nicolás wrote:

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.



Not really. Note that labels and cross-references are only updated when
we export to latex.


Does this mean that the labels in child file generated by File>Export>Latex
will differ depending on whether the export is done from the parent or
the child? (Or, maybe,  depending on whether the child was opened
directly or via the parent file? Or whether the parent file is opened
in lyx at the time of the export?)


No, AFAIK labels are not changed at latex export. The one you see within 
LyX are the one really put in the latex file. Just have a look at 
View->source to make sure of that. In 1.6, the DUPLICATE markers are 
only for screen representation, they are of course not exported to LateX.


Abdel.



Re: Discussion: Labels and parent-child documents

2008-06-03 Thread G. Milde
On  3.06.08, Nicolás wrote:

>> 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.

> Not really. Note that labels and cross-references are only updated when
> we export to latex.

Does this mean that the labels in child file generated by File>Export>Latex
will differ depending on whether the export is done from the parent or
the child? (Or, maybe,  depending on whether the child was opened
directly or via the parent file? Or whether the parent file is opened
in lyx at the time of the export?)

Günter


Re: Discussion: Labels and parent-child documents

2008-06-03 Thread Abdelrazak Younes

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.


Side note FYI: In 1.6 duplicate Labels are not changed automatically but 
they are clearly marked as DUPLICATE in the work area and in the new 
Navigator (former outline pane). So it's easy to spot where the problems 
lie in the document. Also worth of note is that 1.6 won't allow the 
creation of duplicate labels, it will automatically rename the duplicate 
label. Another interesting feature is that broken are marked as BROKEN.


Abdel.



Re: Discussion: Labels and parent-child documents

2008-06-03 Thread Nicolás


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.


Not really. Note that labels and cross-references are only updated when we 
export to latex.



But maybe something like this could be made to work. You're welcome to 
bugzilla it.




I just wanted to see what people thought about it before opening a file in bugzilla. But it seems most people do not have an opinion on 
this :-)

I will report it now on bugzilla.


rh






Re: Discussion: Labels and parent-child documents

2008-06-02 Thread rgheck

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



Discussion: Labels and parent-child documents

2008-06-02 Thread Nicolás
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.


Cheers,
Nicolás


rgheck wrote:

Humberto Castejon wrote:

Hi!

I have just realized that when importing child documents, the labels 
of the different documents may overlap. That is, the same label may 
have been used, e.g., in two child documents. Does LyX take this into 
account and add any kind of prefix to the labels of the children 
documents? If not, I think this would be a nice feature, rather than 
having to modify manually the overlapping labels.


No, you don't really want LyX to do that. It should be possible to 
reference labels in one child from the other children---which it is, as 
things are. If you start modifying the labels themselves, then you would 
have also to modify the references to those labels. But then how do you 
know which one you meant to reference?


rh