>>Date: Thu, 27 Apr 2006 14:28:29 +0200 >>From: "Martin A. Hansen" <[EMAIL PROTECTED]> >>To: "Jean-Pierre Chretien" <[EMAIL PROTECTED]> >>Subject: Re: poor resolution for svg >>Cc: [EMAIL PROTECTED], [EMAIL PROTECTED], lyx-users@lists.lyx.org, [EMAIL >>PROTECTED] >> >>a word of caution! >> >> >>inkscape does a poor job converting to eps and pdf. inkscape developers are >>well aware of this and they are contemplating hiring a programmer to do a >>svg->ps library. >> >>among the problems are scaling, cropping, and clippaths which results in bad >>output. if you donnot use these features, you might be lucky getting a >>correct ps output, but i would not recomment it for now. >> >>inkscape does nice pngs though.
This is enough for pdflatex compilation. You may use then convert for eps, for plain latex compilation. I mentioned in a previous mail that conversion to eps looses the transparency, this is true when I display the graphic, but I can't see any difference in the pdf results when I insert it in LyX and compile either with pdflatex (png) or with latex (eps). I think I mentioned that the png command line export was cropped , that is not true, sorry the full page is exported (you may restrict export to the selection from the GUI). Here is a short perl script which calculates the bbox from requests to inkscape I wonder if there is a more elegant way: ->cat svg2png #!/usr/bin/perl use File::Basename; ($name,$path,$suffix) = fileparse($ARGV[0],('\.svg')); $file=$name.$suffix; $x0=`inkscape --query-x $file`; chop($x0); $y0=`inkscape --query-y $file`; chop($y0); $w=`inkscape --query-width $file`; chop($w); $h=`inkscape --query-height $file`; chop($h); $x1=$x0+$w; $y1=$y0+$h; `inkscape --export-area=$x0:$y0:$x1:$y1 -e "$name.png" $file`; exit; This would be better written in bash or csh of course. Then the converter in LyX would be svg2png $$i, one svg is declared in the known formats. HTH -- Jean-Pierre