I would like to report a problem which may be a bug related to the
changes to "\input@path" in 2.0.1.  I cannot get epstopdf to work with
Lyx 2.0.1 or 2.0.2, although it worked perfectly with Lyx 2.0.0.

I have read a thread in the devel mailing list with the subject
"epstopdf fails with 2.0.1svn" (last post dating back to June 2011)
but I think that refers to a different problem.

=========================
 TO REPLICATE THIS BUG
=========================

1) Generate a graph from gnuplot using the "epslatex" terminal. This
outputs 2 files: a .tex file and a .eps file.  For the purposes of
this description, let's call our output files "graph.tex" and
"graph.eps". graph.tex includes the line:
"\put(0,0){\includegraphics{graph}}".

2) Create a Lyx document in the same directory as your "graph.tex" and
"graph.eps" files. Insert the following ERT into the Lyx document:
"\input{graph.tex}".

3) Assuming you're starting with the default Lyx config, you'll need
to tell Lyx to pass the "-shell-escape" parameter to pdflatex during
compilation.  Go to Tools > Preferences > File Handling.  Select
"LaTeX (pdflatex) -> PDF (pdflatex)".  Modify the "Converted:" field
so it reads: "pdflatex -shell-escape $$i".  Click "Modify" and "Save".

4) Add the following 2 lines to the Lyx document's LaTeX preamble:
    \usepackage{graphicx}
    \usepackage{epstopdf}

5) Try converting this Lyx document to PDF.  This succeeds in Lyx
2.0.0 but fails in Lyx 2.0.1 and 2.0.2.

======================================
 WHY IT FAILS IN LYX 2.0.1 and 2.0.2
======================================

The problem is that Lyx runs epstopdf in a temp directory (e.g.
"/tmp/lyx_tmpdir.T13883/lyx_tmpbuf2") but epstopdf is not given a way
to locate the .eps file. The Lyx log file reports that epstopdf is
called like this:

runsystem(epstopdf --outfile=graph-eps-converted-to.pdf graph.eps)

As you can see, epstopdf has no way of finding where "graph.eps" lives.

==============================
 WHY IT WORKED IN LYX 2.0.0
==============================

Just as with Lyx 2.0.1 and 2.0.2, Lyx 2.0.0 runs epstopdf in a temp
directory. The big difference is that Lyx 2.0.0 successfully provides
epstopdf with the correct absolute path to find the .eps file.

====================
 FIXES I'VE TRIED
====================

I have tried setting "\graphicspath{{/path/to/eps/file/}}" in my
document preamble but this did nothing.

I tried adding my graphics directory in Lyx's "Working directory",
"Temporary directory", "PATH" and "TEXINPUTS prefix" Paths fields but
this did not help.

The only "fix" I have found so far is to open each .tex file (e.g.
graph.tex) in a text editor and manually edit the
"\put(0,0){\includegraphics[width=\unitlength]{graph.eps}}" line to
include the absolute path of the .eps file.  This is not a
satisfactory solution for many reasons.

I've tried putting #!/usr/bin/perl at the top of the epstopdf.pl but
this does not help.

I'd really love it if someone could suggest a solution!

Reply via email to