LyXExport to plain LaTeX gives pixelated EPS graphics

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Ecks
Posts: 2
Joined: Wed Oct 24, 2012 5:03 pm

Export to plain LaTeX gives pixelated EPS graphics

Post by Ecks »

I'm using LyX to create LaTeX code for a journal submission and my graphics are in .PDF format natively. When I command LyX to export to LaTeX (plain), it converts my .pdf graphics into .eps as it should, however the .eps files are of very pixelated. I've done enough digging at this point to figure out that LyX uses Imagemagick to convert to .eps, and as it turns out, Imagemagick rasterizes anything that comes through it. That explains the pixelation, so is there a way to command LyX to use a converter other than Imagemagick to create the .eps files? I'd really like to have LyX call on pdftops.exe to run the conversion, but have no idea how to get that to happen during export to plain LaTeX.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

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

Export to plain LaTeX gives pixelated EPS graphics

Post by scottkosty »

Ecks wrote:I'm using LyX to create LaTeX code for a journal submission and my graphics are in .PDF format natively. When I command LyX to export to LaTeX (plain), it converts my .pdf graphics into .eps as it should, however the .eps files are of very pixelated. I've done enough digging at this point to figure out that LyX uses Imagemagick to convert to .eps, and as it turns out, Imagemagick rasterizes anything that comes through it. That explains the pixelation, so is there a way to command LyX to use a converter other than Imagemagick to create the .eps files? I'd really like to have LyX call on pdftops.exe to run the conversion, but have no idea how to get that to happen during export to plain LaTeX.
I think it does use pdftops. Go to Tools > Preferences > File Handling > Converters. Then go to PDF (ps2pdf) -> EPS and you will see

Code: Select all

pdftops -eps -f 1 -l 1 $$i $$o
That is where you can choose what other parameters to pass to pdftops.
Let us know what you change that to and if you are happy with the results.

Scott
Ecks
Posts: 2
Joined: Wed Oct 24, 2012 5:03 pm

Re: Export to plain LaTeX gives pixelated EPS graphics

Post by Ecks »

Thanks for the lead. Turned out that I had set my converter to pdftops only for the PDF (pdflatex) -> EPS conversion. After setting pdftops for PDF (ps2pdf) -> EPS conversions, I at least was able to get an error message when I tried to convert, due to the fact that I hadn't put the pdftops.exe file in LyX20/bin. After fixing that, I was able to make a successful conversion at last. To my delight, this also fixed a similar problem I was having when exporting to HTML format. Now the .png files that get bundled with the HTML export are much sharper and actually legible. Thanks Scott!
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: Export to plain LaTeX gives pixelated EPS graphics

Post by scottkosty »

Great! Good job figuring it out.

Scott
Post Reply