----- Original Message ----- From: "Sven Schreiber" <[EMAIL PROTECTED]>
To: <lyx-users@lists.lyx.org>
Sent: Friday, August 19, 2005 3:05 AM
Subject: Re: output refresh when only graphics change?


Paul A. Rubin wrote:
Sven Schreiber wrote:

How can I force lyx to run a latex cycle when only an included graphics
file has changed?

Lyx doesn't seem to notice the change (which I understand) and >>>therefore only offers the output from the buffer with the old graphic.

Workaround is to close and reopen the lyx-file, but surely this is not
really necessary?

Thanks, Sven

I've experienced this myself.  Easier workaround: insert a space
(anywhere) and then delete it, so that LyX thinks the document has changed.


Paul, that was the first thing I tried, but it didn't work (although
normally I agree it works). At least in this situation, Lyx apparently
understands that nothing has changed. Instead of closing the file,
however, I can also 1. insert a word, 2. update, 3. delete the word, 4.
update, and all is as it should be.

Actually it is difficult to construct a simple test case, so this seems
to be a rather subtle bug that is triggered only in special
circumstances. Maybe it helps to describe the situation where it occurred:

1. I have a lyx document with pdf graphics included (lyx 1.3.6 on win
2000, could also try xp, haven't tried yet)
2. I edit one graph by updating the .eps, and then running it through
eps2pdf.exe (a wrapper around ghostscript, I believe) which updates the
.pdf.
3. Then I try "update" in lyx and... no latex run, so nothing changes.

I could do more testing if somebody tells me in which direction.
-Sven


I read this article which may have a bearing on the issue, although
the article discusses "TeX and MS Windows - Post Scripts " I
think it may help (maybe only me) to understand the process.

How to compile to PDF: http://student.dcu.ie/~mcmahon4/WinTeX2.html

The recommended method is to:
 1.. Convert EPS files to PDF using eps2pdf.exe
 2.. Compile main document to PS by using laTex.exe, dvips.exe
 3.. Compile main document to PDF using pdflaTex.exe
These programs are all bundled with MikTex. The important point to note about this procedure is that step 2 requires that the graphics are saved as EPS files while step 3 requires the graphics to be saved as PDF files. When LaTex is compiling the sample code above, it looks for "graph.eps" in step 2 and "graph.pdf" in step 3. "graph.pdf" is of course generated at step 1.

However, there's a problem:

eps2pdf.exe rotates the graph through 90 degrees into a portrait. Using the pdflatex.exe tool at step 3 displays this rotated graph, not the original landscape graph.

The first solution that I came across was to complete steps 1 and 2, and then to use GhostView (see main article) to convert the resulting PS (documentname.ps) to PDF. This displays the landscape graph correctly.

Unfortunately this solution yields a poor quality PDF with slightly fuzzy text. The PDF prints perfectly but is hard to look at on screen for any length of time.

The second and best solution (that I came across) was to complete steps 1 and 2, and then to use MikTex's dvipdfm.exe package to convert documentname.ps to documentname.pdf. This results in a very good quality PDF. It is, however, important to specify the size of the paper. Otherwise the text and images will be centred incorrectly in documentname.pdf . A4 is specified with the command line [3]:

C:\>dvipdfm -p a4 documentname.dvi

I ran this program through Windows 2000's MS-DOS prompt emulator and from the MIKTex "BIN" folder. In order to save time (in the short term) I copied the necessary files:
 a.. documentname.dvi
 b.. graph.eps
 c.. graph.pdf
to the BIN folder.

There may be better ways around the portrait/landscape problem, but the steps outlined seem to work well.

To conclude: I strongly recommend that anybody importing graphics into LaTex for the first time read "Using imported graphics in LaTex 2e" [1]. Aside from the technical difficulties outlined above, you will also need to learn how to locate and size your graphics.
SH: The article is two years old.
-----------------------------------------------------------------------

How does the eps2pdf work?

It works like the perl script without perl but requires GhostScript and is capable of converting a list of selected files. This program invokes gswin32c.exe with the selected parameters.

There are two major steps in processing a EPS file:

1. Creating an temporary EPS file in order to shift the coordinate system of the figure inside of the EPS file to cause the BoundingBox's lower left corner to be placed in the coordinate origin.

2. Calling the gswin32c.exe with the selected parameters to do the actual conversion. ...

The EPS files of 10 Mb or less are read into the RAM, updated there and saved as temporary file on the disk. Bigger EPS files are read, updated and saved as temporary file in blocks of 1kb.

The eps2pdf assumes that the bounding box is stored within first 1024 bytes of the EPS file (which is rarely not true!).

------------------------------------------------------------------------------

Regards,
Stephen

Reply via email to