Bo Peng wrote:

>> The procedure would be exactly the same without auto, see below.
> 
> I will see. The problem is with conversion.
> 
>> I don't buy that. Without auto, you do this:
>> - work on the .lyx and the external files the usual way
>> - if you want to send it to a colleague, switch embedding on and send the
>> file
> 
> Then, you lose the original file information.

I thought that you stored this info for all files.

>> - when you get it back, switch embedding off and possibly confirm the
>> overwriting of some files, on a case by case basis or all at once.
> 
> No. The problem is with the insets! When you have a single version,
> they are coded with that file. Then, when you pack/unpack, you will
> need to update the insets. This is not always doable.
> 
> If your figures are within the document directory. You can handle this
> problem by relative path, to document directory (external) or to
> temppath() (embedded). However, when you have a figure that uses
> absolute path, I do not see a way to retain its path information.

That is a problem anyway: You either store this info (privacy problem) or
not. Again, this is unrelated to the auto setting, because you need this
info in both cases. As a first step one could refuse to embed files outside
of the document directory. That would solve the privacy problem. If you do
not want to have this restriction then you need to find a way to deal with
the privacy problem, whether you implement AUTO or not.

>> Or you could choose to have embedding permanently on and never use
>> external files (this would also be possible with auto IIUC).
> 
> This makes updating figures difficult, a major problem with
> word/embedding.

If the figures are created by some external (possibly automated) process, or
if you have some special environment for editing them it would of course be
unwise to permanently embed them. In all other cases it is easy: You simply
click the edit button in LyX. The important thing is that you have the
choice: Nobody forces you to permanently embed the files, but if you want
that you may do so.

>> For example, when I close LyX, edit an
>> external .png file with gimp, and open LyX again, how should LyX know
>> that in this case it should use the external file instead of the embedded
>> one, because I did not receive a modified file from a colleage?
>> It cannot know, so I have to tell it (by switching embedding off).
> 
> The default is always use external file, just like what will happen to
> plain-text lyx file. (Such compatibility is one of the reasons for
> AUTO).

This is dangerous: If your colleague modified an embedded file your outdated
external file will be used, and the modified version will be overwritten on
the next save. Or would it ask before doing that? Then there would be no
difference to the manual deembedding.

With this behaviour the only benefit of AUTO is that you do not need to
change the embedded status before you send/after you receive the file. IMHO
this benefit is far too small to justify the problems this feature creates.

>> And if I edit an external file while my colleague has the embedded file I
>> do not want it to get overwritten by the embedded version, so 'auto'
>> cannot be completely automatic and needs also a confirmation. But then
>> where is the advantage of auto?
> 
> Again, .lyx will use your modified version by default. If you unpack,
> lyx will ask you if you want to overwrite.

OK, so no difference between AUTO and explicit unpack here.

>> Which information is lost?
> 
> To be exact, path of files outside of document directory and which
> files will always be embedded or external (info in manifest).

That is not a problem. When you deembed the paths go into the insets. And
the other information is not needed after deembedding without auto. When
you embed, you store the path info and the list of embedded files somewhere
(explicitly in the manifest or implicitly, this does not matter here). I
still don't see any lost information.

>> I don't understand.
> 
> OK. Let us use your suggestions: simple on/off.
> 
> Embedded .lyx:
> 
> Insert figure, always embedded, remove or modify external file does
> not matter. Difficult to update figure.

I would not consider clicking the edit button in LyX difficult. But even if
you do: Simply switch embedding off after you receive the file, and switch
it on before you send it again. This should not be more than one mouse in a
suitable dialog click each time.

> Plain-text .lyx:
> 
> Insert figure, not embedded, remove or modify external file matters.
> Easy to update figures.
> 
> What I have tried is:
> 
> Insert figure, AUTO embedding, remove or modify external file matters.
> Easy to update figures.
 
> I do understand. I think we should first figure out the major ways of
> using this embedding feature, before we talk about implementations. I
> guess you have understand now that I want embedding, as well as the
> convenience of modifying external files.

I understand and I agree, but IMHO this is possible without any AUTO
setting.

> Without AUTO, after I update 
> an figure, I will need to go to the lyx document, locate the figure,
> re-insert or update the inset.

This is not what I have in mind. Of course the embed/deembed operations
should automatically change the insets so that they refer to the correct
file.


Georg

Reply via email to