# Turning Inkscape drawings into TikZ code with svg2tikz

> svg2tikz converts SVG graphics into TikZ/PGF code, either as an Inkscape extension or as a command line tool installed from PyPI. It is a narrow converter pinned to one Inkscape release series, and its value lies in removing hand transcription rather than in offering layout control.

**xyz2tex/svg2tikz** — An Inkscape extension for exporting SVG paths as TikZ/PGF paths

- Repository: https://github.com/xyz2tex/svg2tikz
- Website: http://xyz2tex.github.io/svg2tikz/
- Stars: 734 · Forks: 110
- Language: Python
- License: NOASSERTION
- Published: 2026-10-21 · Updated: 2026-10-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/xyz2tex-svg2tikz

## A converter for people who already draw in Inkscape

svg2tikz, formerly known as Inkscape2TikZ, is a set of tools for converting SVG graphics into TikZ/PGF code. The problem it solves is narrow but real for LaTeX authors: a diagram drawn as vector art usually arrives as SVG, and a LaTeX document cannot embed SVG directly. The usual path is to redraw the figure in a vector drawing program built for LaTeX, which means reading coordinates off one format and retyping them into another.

The intended user is already comfortable with Inkscape and already has a TikZ document to drop the result into. The output is source code for a LaTeX drawing package, not an image file, which is the whole point. A figure that arrives as TikZ stays in the document as text, so it inherits the document's fonts and scales with its surroundings.

The project also keeps the older name alive in its own description, which is worth noting because search results and existing documentation still use Inkscape2TikZ. The current release line is labelled for Inkscape 1.4.x compatibility, and the description on the repository page frames it as an extension for exporting SVG paths as TikZ/PGF paths.

## The dependency pins decide whether it installs at all

The pyproject.toml file shows a narrow and deliberately tight dependency set, and the pins are the story here. The Python requirement is ^3.12,<4.0, so the project does not support anything older than Python 3.12. lxml is pinned to ^5.1.1, inkex is pinned to the exact version 1.4.0, and pygobject is capped at <=3.50.0.

The inkex pin is the constraint to understand before you plan an adoption. inkex is the Inkscape extension API, and pinning it to exactly 1.4.0 means the tool is built against one specific Inkscape release series. The project describes itself as Inkscape 1.4.x compatible, which is consistent with that pin. When Inkscape moves to a new extension API version, this package needs a matching release before it will work in that environment.

The pygobject cap is explained in the troubleshooting notes rather than in a code comment. The documentation states that pygobject<=3.50.0 is added to the dependencies to fix an issue about gir1.2-girepository-2.0, and that if you cannot install libgirepository1.0-dev, or its equivalent, the advice is to open an issue. Build tooling is Poetry, with a poetry.lock file at the top level and a poetry-core build backend.

## Installing the command line version from PyPI

The package is published on PyPI, which is the route to use if you want to drive the conversion from a terminal rather than from the Inkscape menus. The documentation gives two commands, and they differ only in how the environment is managed.

```bash
pip install svg2tikz
```

```bash
pipx install svg2tikz
```

The first installs into the active Python environment, the second installs it as an isolated command line application. Whichever you choose, the result is a console entry point declared in the pyproject.toml, mapped to the main_cmdline function in the svg2tikz.tikz_export module.

```toml
[tool.poetry.scripts]
svg2tikz = "svg2tikz.tikz_export:main_cmdline"
```

That entry point tells you something about the architecture. The command line wrapper is one route into the same export code the Inkscape extension uses, not a separate implementation, so output produced from a terminal and output produced from the extension should come from the same conversion logic. The entry point name on its own does not document the accepted arguments, so the exact flags have to be confirmed from the project's own documentation page rather than assumed.

For the extension itself, the repository points to a separate installation page, which is where the Inkscape side of the setup is described.

## The alternative is retyping path data by hand

The comparison worth making here is not between two converters but between the converter and the manual workflow it replaces. Hand conversion means opening the SVG source, reading the path data, and translating it into TikZ path commands, curve by curve. It is exact but slow, and it is error prone in a way that is hard to notice, since a slightly wrong control point produces a figure that still compiles and still looks almost right.

svg2tikz changes the approach rather than the goal. The dependency list pairs an XML parser, lxml, with inkex, the Inkscape extension API, which means the conversion runs against the document that Inkscape itself has open rather than against an unrelated text file. The output is TikZ source code generated from the drawing data, so the manual transcription step is the part that disappears.

What does not change is the constraint that the original drawing remains the source of truth. If someone edits the figure in Inkscape afterwards, the exported TikZ has to be regenerated, and the project documentation does not describe a watched directory or a build hook that does this automatically. The repository has a scripts directory and a tests directory, and pytest is configured with testpaths pointing at tests, but the automated conversion pipeline for a document is not described in the sources available here.

## Installation failures show up as lxml and girepository errors

The troubleshooting section in the repository documentation is short and points at two specific problems, both of which are known failure modes for Python packages that reach into the GObject introspection stack used by GTK desktop applications.

The first is an lxml error during installation, and the documentation links to an existing Stack Overflow answer about pygobject failing to configure when gobject introspection is missing. The second is the gir1.2-girepository-2.0 issue that the pygobject<=3.50.0 cap was added to address. Both failures appear at install time rather than at run time, which is the one point in favour of the design: a broken environment is discovered immediately, and the cap on pygobject is already baked into the declared dependencies rather than left for you to discover.

The remaining escape hatch is honest but blunt. If libgirepository1.0-dev, or the equivalent for your distribution, cannot be installed, the documentation says to open an issue. In practice this means the practical audience for the package is people on a desktop Linux system with the GTK development headers available, or people installing it inside an environment that already provides them. There is no wheel-only path described in the sources available here, and no mention of a fully self contained installer.

## Licence terms sit in tension with how the output is used

Licence status here needs precision, because the sources describe it in three slightly different ways. The project metadata lists the licence as Other, a custom licence that the hosting platform cannot classify, and the README points to a LICENSE file at the root of the repository. The pyproject.toml file, which is what tooling actually reads, declares license as GPL-2.0-or-later. The README text also states that the project is licensed under the GNU GPL.

For a user this matters less than it might appear. The generated TikZ is a derived artefact in ordinary legal terms, and the standard reading of the GPL is that output data produced by a tool is not itself a covered work. Anyone treating that as settled for their own use should read the LICENSE file, since the README is not the licence text and the metadata classification suggests the file contains terms the platform could not map automatically.

The more concrete point for engineers is distribution. A GPL-2.0-or-later dependency in a build or conversion pipeline brings licence obligations that come with linking or bundling the tool, and those obligations do not extend to the figures it produces. Organisations with a policy on GPL tooling in their documentation pipeline should check the LICENSE file directly rather than relying on the badge or the metadata field.

## A 3.3.x line with recent commits and a documented changelog

The project is not archived and the last push was on 2026-10-07, so the repository is receiving work. The release history shows three recent tags: v3.3.4 on 2025-11-30, v3.3.5 on 2026-06-14, and v3.3.6 on 2026-06-15. Two patch releases landed a day apart in June 2026, which suggests quick fixes rather than a feature cadence.

The current pyproject version matches the newest tag at 3.3.6, so the published package and the repository tip agree. A complete changelog is kept in the CHANGELOG.md file at the root of the repository, and the documentation site has its own installation and contribution pages, the latter pointing at a separate contribute page.

The upgrade story is favourable in one respect and constrained in another. Favourable because the surface area is small: one console entry point and one conversion engine, with the risk concentrated in the dependency pins rather than in a large API surface that could break. Constrained because the inkex 1.4.0 pin means each new Inkscape series eventually needs a new svg2tikz release, and the six month gap between v3.3.4 and v3.3.5 shows that those compatibility bumps are not always immediate.

## Conclusion

Use svg2tikz if you already author figures in Inkscape and want TikZ output without retyping coordinates, and skip it if your drawings must survive an Inkscape upgrade untouched or if your LaTeX workflow cannot tolerate a GPL-2.0-or-later dependency in the build chain. Before committing, confirm that the inkex 1.4.0 pin matches your installed Inkscape 1.4.x, and check the CHANGELOG.md in the repository for the changes between the 3.3.4 and 3.3.6 releases you would be adopting.

## FAQ

### How do I install svg2tikz from the command line?

The package is published on PyPI, so you can install it with pip install svg2tikz, or use pipx install svg2tikz to keep it isolated as a command line application. The console entry point is svg2tikz, mapped to svg2tikz.tikz_export:main_cmdline.

### Which Python and Inkscape versions does svg2tikz support?

The pyproject.toml requires python ^3.12,<4.0 and pins inkex to exactly 1.4.0, and the project is labelled for Inkscape 1.4.x compatibility.

### I get an lxml or girepository error while installing svg2tikz, what should I do?

The documentation points to an existing answer about pygobject failing to configure when gobject introspection is missing, and notes that pygobject<=3.50.0 is already added to the dependencies to address the gir1.2-girepository-2.0 issue. If you cannot install libgirepository1.0-dev or the equivalent, the documentation asks you to open an issue.

### What licence does svg2tikz use?

The pyproject.toml declares license as GPL-2.0-or-later and the README states the project is licensed under the GNU GPL, with the actual terms in the LICENSE file at the root of the repository.

### Is svg2tikz still being updated?

The repository is not archived and the last push was on 2026-10-07. Recent tags include v3.3.4 on 2025-11-30, v3.3.5 on 2026-06-14 and v3.3.6 on 2026-06-15, with a complete changelog in the CHANGELOG.md file.

## Sources

- [Issues](https://github.com/xyz2tex/svg2tikz/issues)
- [Project website](http://xyz2tex.github.io/svg2tikz/)
- [README](https://github.com/xyz2tex/svg2tikz/blob/master/README.md)
- [Releases](https://github.com/xyz2tex/svg2tikz/releases)
- [xyz2tex/svg2tikz on GitHub](https://github.com/xyz2tex/svg2tikz)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/xyz2tex-svg2tikz
