4

I'm trying to understand how Inkscape works with LaTeX? What are the steps to export any figure drawn with this program in LaTeX language? Is the code TikZ or something else? Could someone suggest me how to proceed? Thank you.

6

Ok so here we go.

I decided to make this visual tutorial because some people are just more cartesian... Also because the extension has changed in the last years.

But don't be lazy, be sure to check this answer and this too, and if you run into problems with text check this.

First thing is to download the svg2tikz (here), this should be pretty straightforward, just click on the green button and save (or open) the .zip file.

Open your windows explorer and go to C:\Program Files\Inkscape\share\extensions it is inside this folder that the extension files will be drop, leave it open.

Open the zip file and navigate to svg2tikz-master\svg2tikz\extensions\ it should look like this:

7zip with extension

Select the first 3 files and drag'n'drop them to the folder you left open before. This should be C:\Program Files\Inkscape\share\extensions, and look like this:

inkscape extension folder

Once you done that, open Inkscape. Make your drawing and select Save As...

random lines

You may also use the Extension menu and go for Export, but you won't get to choose where the file is saved.

At the end of the list you will see Tikz Code .tex like this:

save as tikz code

In my example the image code is:

\begin{tikzpicture}[y=0.80pt, x=0.80pt, yscale=-1.000000, xscale=1.000000, inner sep=0pt, outer sep=0pt]
  \path[draw=black,line join=miter,line cap=butt,line width=0.056pt]
    (12.2944,5.9435) -- (23.2524,102.6950) .. controls (35.7691,59.6863) and
    (34.2478,-2.8197) .. (107.7096,38.8176);

\end{tikzpicture}
  • 1
    Perfect! Thank you. How can I vote positive your answer? – user161692 Jun 13 '18 at 20:34
  • 1
    @Maria You are welcome. Please check the little "V" thats under the upvote so my answer will show as "Accepted". The upvote is not so important as the acceptance is. With time other users can upvote, but only you can accept (because you made the question). – G. Bay Jun 14 '18 at 0:56
1
  • download svg2tikz from https://github.com/kjellmf/svg2tikz

  • Extract the files tikz_export.py, tikz_export_effect.inx, and tikz_export_output.inx from svg2tikz-master/svg2tikz/extensions and put them in the share/extension directory inside the Inkscape installation directory, and it is in /usr/share/inkscape/extensions for ubuntu

  • Draw desired picture in Inkscape

  • Export from the menu: Extension -> Export -> Export to TikZ path

  • the extentions directory for Inkscape also can be ~/.config/inkscape/extensions – cggos Jul 12 at 5:37

Your Answer

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