LaTeX forum ⇒ LyXCannot display EPS files inside Lyx

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Posts: 1
Joined: Wed Apr 01, 2015 11:38 pm

Cannot display EPS files inside Lyx

Postby kazis » Wed Apr 01, 2015 11:46 pm

Hello everyone,

I trying to include matlab figures (.eps files) into my lyx document. However, I get the errors such as file cannot be converted to loadable format, or error loading file into memory. I know there is a lot of posts out there about this problem, but they haven't helped resolve the issue.

Things I have already tried:
1) added EPS>PNG in file handling (this allows me to see the figures in the generated PDF but not in Lyx)

2) downloaded ghostscript package for MacOS from the follwing site:

then I reconfigured lyx, but no luck.

Please let me know your suggestions. Also, please assume layman's knowledge when replying.

Thank you in advance!!

Posts: 2
Joined: Mon Apr 18, 2016 4:20 pm

Postby xiaoquanzz » Mon Apr 18, 2016 4:40 pm

Hallo Kazis,

Have you fixed this problem? I have the same problem today and I have figured out the solution which works for me now.

Here are the steps that I have done(for Mac OS X).

1. In Lyx preview, graphs are converted to PNG for display. Conversion from eps to png can be done by convert command provided by ImageMagick. First type covert /path/fig.eps /path/fig.png in terminal to check if convert command is working properly. If not, install ImageMagick first(

2. Then add EPS to PNG converter in Lyx follow Lyx>Preferences>File Handling>Converters. Choose EPS->PDF and change the 'to format' from PDF to PNG. In the converter line, type "convert $$i $$o" and then press add and save.

3. Now you have to add the path where convert is located to Lyx. Mine is located at /opt/ImageMagick/bin. Go to Lyx>Preferences>Paths>Path prefix add :/opt/ImageMagick/bin to the end of the paths. Save the paths and exit Lyx.

4. Reload the file with eps graphs should display graphs in preview now.

That is what I have done. Hope works for you too if you have not fixed the problem yet.

Site Moderator
Posts: 531
Joined: Sat Sep 01, 2012 6:38 am

Postby scottkosty » Tue Apr 19, 2016 6:00 pm

I've had one report from a Mac user who had this problem that it is fixed in LyX 2.2.0rc1, which can be downloaded here:

Return to “LyX”

Who is online

Users browsing this forum: No registered users and 1 guest