Alex Fernandez wrote:
> Excuse my ignorance, but why should it do that? Let us follow the
> sequence of events and you tell me where I have it wrong.
> - A document is located at, say, /home/work/doc.lyx, referencing
> /home/work/pic.eps (as a relative path, i.e. "pic.eps").
> - The document (not the image) is copied to /tmp/random/doc.lyx to
> convert to html.
> - eLyXer is run --directory /home/work.
> - eLyXer converts /home/work/pic.eps to /tmp/random/pic.png.
> - The generated html /tmp/random/doc.html references "pic.png".
> - The files doc.html and pic.png are copied from /tmp/random to
> /home/work/doc_lyx/
> - The user opens the newly created html file and sees a brand new image.
>
> Why does eLyXer have to reference the image at its original location
> /home/work/pic.eps? The generated file is not even going to be there.
> Besides, absolute paths are a no-no if the html file is to be
> published anywhere, or even moved within the hard disk.

The whole point is that the pictures are _not_ copied to the tmp dir. They are 
still (only) in /home/work/. 
If you use LaTeX as an intermediate step, LyX copies the pictures, but it 
mangles the filename. /home/work/pic.eps will become something like 
tmp/home_work_pic.eps. This is to allow a document to include to different 
files with the same name from different directories, e.g. /home/work/pic.eps 
and /home/private/pic.eps

As Richard said, eLyXer might copy them to the tmp dir, but I'm not sure this 
will work for pictures from different directories. Imagine I my 
/home/work/doc.lyx includes a file /extras/pix/pic.png and another one 
../private/pic.png. I think this will be difficult to resolve (without 
filename mangling as we do for LaTeX output).

So I think that using absolute paths that point to the original files is the 
easisest thing to do to resolve view from within LyX. I agree that no absolute 
path should be used on export, which is probably what people do for the 
published version.

> Thanks,
>
> Alex.

Jürgen

Reply via email to