Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inkscape "PDF + Latex" export

I'm using inkscape to produce vector figures, save them in SVG format to export them later as "PDF + Latex" much in the vein of TUG inkscape+pdflatex guide.

Trying to produce a simple figure, however, turns out to be extremely frustating.

The first figure enter image description here is an example of the figure I would like to export in the form of "PDF + Latex" (shown here in PNG format).

If I export this to a PDF figure without latex macros the PDF produced looks exactly the same, except for some minor differences with the fonts used to render the text.

When I try to export this using the "PDF + Latex" option the PDF file produced consists on a PDF document of 2 pages (again as .png here): enter image description here

This, of course, does not looks good when compiling my latex document. So far the guide at TUG has been very helpful, but I still can't produce a working "PDF + Latex" export from inkscape.

What am I doing wrong?

like image 235
Arlex Marín Avatar asked Apr 30 '15 19:04

Arlex Marín


2 Answers

I asked this question on the Inkscape online discussion page and got some very helpful guidance from one of the users there.

This is a known bug https://bugs.launchpad.net/ubuntu/+bug/1417470 which was inadvertently introduced in Inkscape 0.91 in an attempt to fix a previous bug https://bugs.launchpad.net/inkscape/+bug/771957.

It seems this bug does two things:

  1. The *.pdf_tex file will have an extra \includegraphics statement which needs to be deleted manually as described in the link to the bug above.
  2. The *.pdf file may be split into multiple pages, regardless of the size of the image. In my case the line objects were split off onto their own page. I worked around this by turning off the text objects (opacity to zero) and then doing a standard PDF export.
like image 28
weymouth Avatar answered Sep 22 '22 05:09

weymouth


I worked around this by putting all the text in my drawing at the top

select text and then Object -> Raise to top

Inkscape only generates the separate pages if the text is below another object.

like image 169
rzach Avatar answered Sep 22 '22 05:09

rzach