1

I recently put some SVG graphs in a LyX document I'm working on. When exporting to PDF with LyX 2.2.3 on Windows, everything looks as expected (the graphs don't loose quality when zoomed in).

After that I run my file through my system for automated deployment, that exports it with a LyX 2.2.3 installation on Ubuntu by running lyx --export pdf2 Filename.lyx.

The resulting file has a "rasterized" version of the SVG image, of which I can clearly see the pixels when zooming in.

I tried installing Inkscape before LyX but not reconfiguring it as suggested, because I didn't find a way to do it through command line. I think installing it before LyX makes the reconfiguration useless anyway.

Is there a way to solve this by only using console commands?

2
  • Welcome! Please always give your version of LyX for LyX questions. If you install inkscape and reconfiguring LyX, does that help? – scottkosty Apr 17 '18 at 20:43
  • 1
    I added the LyX versions and information about your tips on Inkscape – ERap320 Apr 18 '18 at 12:11
0

If you look at LyX's configure script, it appears that the following is the default command for converting SVG to PDF:

rsvg-convert -f pdf -o $$o $$i

Followed by:

inkscape_name + ' --file=$$i --export-area-drawing --without-gui --export-pdf=$$o'

So if LyX finds rsvg-convert in your path, it will use that even if you have inkscape installed. See, e.g. here. Try adding the following to your LyX preferences file (possibly located in the file ~/.lyx*).

\converter "svg" "pdf6" "inkscape --file=$$i --export-area-drawing --without-gui --export-pdf=$$o" ""

Alternatively, instead of including graphics the normal way of Insert > Graphics, insert your SVG files using Insert > File > External Material > Vector graphics.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.