# Is there any way to type LaTeX code directly into the text boxes Inkscape?

I use Inkscape on Windows 7 platform. The principle to enter integrals and other mathematical symbols in Inkscape seems that the best thing to do and write them in a LaTeX compiler and cut them in Adobe PDF and paste it into Inkscape as figures.

Seems to be how you make pictures like this in Inkscape:

Is there any way to type LaTeX code directly into the text boxes Inkscape?

I know this question is ultópica but it never hurts to try.

-
something like that? –  Spike Jun 26 '12 at 16:36
wiki.inkscape.org/wiki/index.php/LaTeX –  egreg Jun 26 '12 at 16:36
In a nutshell: You can export pdf + latex from inkscape. however, you may have to manually adjust the x,y values of your text positions afterwards. I found that they often don't quite come out as I want them –  Martin H Jun 26 '12 at 20:00

Here an inkscape answer (summarizing the comments and some additional info). There are two ways to include LaTeX input

1) Use the pdf+LaTeX export built into Inkscape

Disadvantage: Tex code can be typed but is not rendered, hence you may need to adjust the x,y positioning values later in your document --> annoying. Further, no line break is supported and you need to add a parbox or minipage or something later manually

2) Get the textext plug-in for inkscape

Advantage: Render the code directly in you inkscape document, including line breaks etc.

Disadvantage: Text becomes a svg picture and can not be edited outside of Inkscape (no problem within Inkscape of course). This means after exporting and including the pdf in your document scaling your graphic will cause the text to scale too --> Possibly undesired effects

Installation details for textext:

Get the Inkscape plugin `textext` from here

Installing it was a bit tricky for me (Inkscape 0.48).

First I placed the extension files in the ~/.config/inkscape/extensions folder Then I installed Pstoedit fia the Ubuntu package manager

After that I was presented with an Error from some python modules. This blog post solved it for me: Blogpost

After that I was able to select Extensions->Textext from my Inkscape menu bar. In the box that pops up type you LaTeX code just like you would in a normal document. You can specify a preamble file. I'd include any packages affecting the font in your document as the result is a SVG image of you TeX input, meaning that the font will not change if you decide to change your LaTeX-preamble at some point

-

You can use Ipe extensible drawing editor for this. I've used it extensively until I got the hang of TikZ but still use it for quick and dirty image preparing. It supports a lot of features implemented (linetypes, colors, transformations, coordinates, object snapping etc.). Also if you know Lua then you can directly hack into it and create your own stuff (I don't).

Here is how you can do as simple as possible. First you draw your shapes, polygons etc. (and also choose to enter LaTeX formula selected in the image below).

Then, after clicking OK either choose Run LaTeX from the menu or Ctrl+L then it finds your LaTeX distro and compiles that part as in the image below. You don't have to do it for each formula, you can keep them as source and then compile all at once.

After finishing your picture, you can save as XML, PDF or EPS formats. After two minutes I have this

-
I find new ideas everyday in tex.stackexchange. I haven't tried this software. There was a time I was using DIA to generate my tikz code. I may have heard or read of Ipe but I never gave it any attention, probably because I don't use Inkscape. I might try it soon. –  hpesoj626 Aug 14 '12 at 14:11
@hpesoj626 It's the poor man's (academia that is) Photoshop :) –  percusse Aug 15 '12 at 23:25
I now realized that I have received a bounty for this answer. I don't know whose bounty it is but thank you very much indeed for a slightly undeserving answer. –  percusse Aug 31 '12 at 14:15

This is really a comment to Martin H, however, I don't have enough reputation to produce a comment at this time.

At this point, following the advice given (by Martin H), I was unsure what was meant in his answer by "I placed the extension files in the ~/.config/inkscape/extensions folder"

Opening Inkscape at this time gives me the TeX Text option under the Extensions menu. However, clicking this yields the same error as encountered by Martin H. Following the link for the blog post provided and then the steps to fix this error, I open Inkscape only to get the error:

``````Traceback (most recent call last):
File "textext.py", line 936, in <module>
e.affect()
File "C:\Program Files (x86)\Inkscape\share\extensions\inkex.py", line 215, in affect
self.effect()
File "textext.py", line 349, in effect
% ';\n'.join(converter_errors))
RuntimeError: No Latex -> SVG converter available:
Pdf2Svg: Command pdf2svg failed: [Error 2] The system cannot find the file specified;
PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] The system cannot find the file specified;
SkConvert: Command pstoedit failed: [Error 2] The system cannot find the file specified
``````
-
~/.config/inkscape/extensions is a folder in Unix/Unix-like OS's. In Windows 7 you can find it your installation folder, usually C:\Program Files\inkscape\extensions. –  hpesoj626 Aug 14 '12 at 14:05
true, sorry for not specifying that in more detail. The path I mentioned is for Linux systems. I am not a Windows user, hence I can not give you much advice. But the message `No Latex -> SVG converter available` shows you that pstoedit installation may not have been successful. You can test it by opening a command window in Windows via Windows start button-> Run type `cmd` click ok and then in the console window that opens type `pstoedit`, hit enter and see if the program can be found. If not, locate pstoedit.exe on your system and add the path of it to the environmental variables in Windows –  Martin H Aug 14 '12 at 16:50