LyX ⇒ Cannot display EPS files inside Lyx
Cannot display EPS files inside Lyx
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:
http://pages.uoregon.edu/koch/
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!!
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
-
- Posts: 2
- Joined: Mon Apr 18, 2016 4:20 pm
Cannot display EPS files inside Lyx
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(http://cactuslab.com/imagemagick/).
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: 542
- Joined: Sat Sep 01, 2012 6:38 am