On 11/23/2018 5:13 PM, Bernt Lie wrote:
I use LyX 2.3.1 on Windows 10, 64 bit.

It seems like LyX sometimes has problems handling SVG files, specifically lines 
with arrow heads.

Here is one example; the original file in Inkscape:

[cid:part1.15EA54CD.05E0F43A@hotmail.com]

In Inkscape, this looks fine. However, when I import this svg file into a LyX 
float figure, this is what it looks like:

[cid:part2.DE22055A.FAC70ADE@hotmail.com]

Observe that some of the arrowheads seems to have a “broken neck”...

If I generate a pdf from Inkscape and import the drawing as a pdf into LyX, 
then there is no problems. But then the preview in LyX looks pixelated.

Q: where is the problem? Is it Inkscape that uses corrupted svg files, or is it 
LyX that doesn’t properly handle arrow heads?

-B



Hello,

I am following this post and just want to make sure if I got it right:

  *   SVG files are not supported by LaTeX directly, am I right? According to 
this StackExchange 
post<https://tex.stackexchange.com/questions/2099/how-to-include-svg-diagrams-in-latex>,
 there are some tricky and tedious ways to include an SVG file without 
converting it to PDF, but they do not seem to be as efficient as including a 
PDF file and compiling with pdflatex.
  *   From the discussion, it is my understanding that LyX comes with an 
external tool to convert an SVG file to an insertable format. Obviously, the 
result will be as good as the tool's capability provided, and the issues with 
the result should be associated with that tool, not LyX. Did I get this correct?
  *   So, if I would like to include an SVG file into my LyX (or LaTeX file), 
it may be a good idea to export it to a LaTeX compatible format (e.g. PDF) 
externally and make sure the conversion is acceptable first. I can use 
different tools such as InkScape, ImageMagick etc.
  *   Alas, it is my experience that it is not always guaranteed to get a 
perfect PDF, particularly when working with quite fragile formats such as SVG 
or WMF or Extended WMF. For sensitive figures as the one given in this post, it 
may be a good investment to kill some time to learn Tikz or PSTricks 
(personally my favorite is TikZ; I can prepare the attached figure in 30 to 60 
mins).
  *   One question I have is, which tool is used to prepare the attached SVG? 
Or is it taken from an external party? If it is prepared by a tool such as  
InkScape, is it possible to save it as PDF from the source?
  *   So, my suggestion here is  not to spend too much time on inserting SVG 
into LaTeX through conversion. For this specific example, I would even prefer 
to get a screen shot with high resolution and include it as PNG into LyX. For 
the future, I would concentrate on tools such as Tikz.

-- Baris
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
Please bottom-post. Start your reply here:

Reply via email to