1

I want to include some psfrag-figures in PDF output with LyX 2.1.3, e.g. ex02.eps & ex02.tex compiled from Matlabfrag's ex02.m, but it does not work. It worked with LyX 1.5.6, see Matlabfrag documentation.

So I included \usepackage{pstool} in the LaTeX preamble (in LyX -> Document -> Settings) and added the image as ERT (Insert -> TeX Code):

\psfragfig{graphics/ex02}

Building the document (Document -> View [PDF (pdflatex)]) shows in the PDF:An error occured processing graphics <code>graphics/ex02.eps' Check the log file for compilation errors:</code>graphics/ex02-pstool.log'

In the mentioned graphics/ex02-pstool.log(in Windows you find it at C:\Users\USER\AppData\Local\Temp\lyx_tmpdir.XXXXXXXXXX\lyx_tmpbufY, where XXXXXXXXX is an arbitrary name and Y a number), there's the following error:

[...]
(C:/Users/USER/Desktop/LyX-Test/pstool//graphics/ex02.tex)

! LaTeX Error: File `ex02' not found.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.50  \includegraphics [] {ex02}

I could not locate the file with any of these extensions:
.eps,.ps,.eps.gz,.ps.gz,.eps.Z,.mps
[...]

For other users to find this bug: In the LaTeX log you'll find:

[...]
Package pstool Warning: Execution failed during process:
    latex -shell-escape -output-format=dvi -output-directory="figures/" -interaction=batchmode  "diagram1-pstool.tex"
[...]

It seems that LyX only copies images to the tmpdir if they are included in the LyX document with \includegraphics. How can I tell LyX to do this also with the .eps and .tex files?

closed as unclear what you're asking by jub0bs, Werner, user13907, Mico, Przemysław Scherwentke Aug 30 '15 at 9:54

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • LyX does not know anything about ERT. So it does not know it is supposed to copy something that is mentioned in ERT. Does it work if you put the full path to the file in ERT? – scottkosty Jul 14 '15 at 10:44

Browse other questions tagged or ask your own question.