FYI: there is another script by the same name that look pretty good: http://www.electricrock.co.nz/tools/inkscape-to-latex-script/
laclaro.wordpress.com provides a really neat method to integrate the functionality of this script on-the-fly with latex builds. It uses the built in svg-latex conversion within Inkscape, avoid the use of this script entirely!
Inkscape 0.48 has been released that has the functionality this script provides built in. You should upgrade and ignore this page if 0.48 works for you! NOTE: One feature that I believe Inkscape export doesn't have is font-size support. svg2latex.py provides basic font size support.
This is a version of my Inkscape extension which converts Inkscape drawings to a image suitable for including in Latex.
It works stand alone. In addition I have renamed it 'svg2latex' and create this new page. I expect to replace the dependency on Inkscape with a Cairo dependency in the future.
This is an example of the different text types and various rotation examples.
and this is what is looks like in latex.
This is a image being edited in inkscape
And this is what it looks like after it has been processed by the script and included into a latex file.
Inkscape 0.48 has been released that has the functionality this script provides built in. You should upgrade and ignore this page if 0.48 works for you!
Current development code is available at gitorious: https://gitorious.org/svg2latex/svg2latex
Download latest version from gitorious
Bug fix for 'flowRoot' data types.
The beginnings of Test suite.
Download latest version 0.7.0 (2010/05/08)
This version now runs on MS Windows.
It includes an option to export a eps file instead of pdf (for use with latex).
Another positioning bug has been identified and fixed.
Download latest version 0.6.2 (2010/05/06)
Raphael Wolfer thoughtfully provided an svg example which resulted in poorly aligned latex output. This helped me make a small modification to improve positioning of text.
Version 0.6.1 (2010/02/22)
Johan Engelen provided a svg file which the code didn't like: it would appear that font sizes can be specified using names (like 'medium'). This version checks to see if a font is a number and uses a default value if not.
Version 0.6 (2009/11/01)
I am very grateful to Tobias Müller for his assistance in preparing this release. I'll move the project hosting to somewhere more social if there is demand - or feel free to do so if you fancy it.
Changes from: 0.5.1
Removed dependency on lxml
Now handles rotating text and flowroot nodes.
Code handels centre align for horizontal text elements.
Code is a bit cleaner
There is a dependency on the python lxml library.
Change from: 0.5
Small bug discovered and fixed when I tested on Fedora 11.
This made the code fall over as os.path.split returned an empty string not None as I was expecting.
You call this script from the command line:
richard@richard-laptop:~/svg2tex$ ./svg2latex.py
--latexoutfile not specified
Convert svg to latex picture format and use
Inkscape to generate a pdf for all the bits
which are not text.
-f [--svgfile] <filename> svgfilename
-l [--latexoutfile] <filename> name for latex output file
-o overwrite the output files automatically
A pdf file is also created. This is given the same name as the
latex outfile with the extension 'pdf'. This file is generated by
Inkscape, which must be on the path for this script to work.
Somethink like:
./svg2latex.py -f ./drawing.svg -l ./svgout.tex
will convert drawing.svg to svgout.tex and svgout.pdf.
Minimising clutter in svg drawing
Mukhtar Ullah shared an idea he had to use the 'description' property of the text object to include long latex strings - and use the displayed text as a place holder:
Just to share it with you, when I include a description, the typset output includes both the desrciption and the usual text one after the other. So I defined a comment command in my latex document \newcommand{\cm}[1]{}. When I have a real long formula, I put that in the description and I place some hint of that inside \cm{}. The document looks neat and the output is what I want.
The file svgout.tex is included into latex in the same way as shown on the origional plugin page. This basically looks like:
\documentclass[11pt,a4paper,twoside]{report} %% LaTeX2e document.
\usepackage{graphicx} %% Preamble.
\usepackage{color}
\begin{document}
\begin{figure}
\begin{center}
\scalebox{1.0}{\input{./somelatexfile.tex}}
\caption{a test of inkscape latex export extension.}
\label{fig:latexexport}
\end{center}
\end{figure}
\end{document}
check the bottom of the inkscapelatexextension page for alternatives - svg2tex which generally works better than my svg2latex code.
Other
I have a project page with some of my projects.
rjhenwood a_t yahoo co uk