#svg #layer #converter #tikz #tiling #file #instance

bin+lib svg-tikz

A customisable converter from SVG to TikZ. The library can be used to write custom converters, for instance to generate multiple different TikZ figures from a single SVG file, or to apply modifications to paths programmatically (this tool was originally designed with tilings in mind).

3 unstable releases

0.2.1 Apr 11, 2019
0.2.0 Apr 8, 2019
0.1.0 Apr 8, 2019

#1 in #tikz

Download history 5/week @ 2024-03-09 28/week @ 2024-03-30 1/week @ 2024-04-06 127/week @ 2024-06-08 6/week @ 2024-06-15

133 downloads per month

MIT/Apache

40KB
1K SLoC

Convert SVG to TikZ, with filters.

This API is meant to create custom SVG to TikZ exporters, possibly filtering or modifying some elements of the original image along the way. The filters work best if the SVG comes from Inkscape.

For instance, selecting only one Inkscape "layer" can be done using the Layers filter:

extern crate svg;
use svg_tikz::*;
use svg_tikz::layers::*;
use svg_tikz::tikz::*;

// Creating an empty SVG file.
std::fs::File::create("input.svg").unwrap();
// Parsing it, outputting only the layer called "my layer"
process_file(
    "test.svg",
    &mut Tikz::to_file("test.tex")
        .unwrap()
        .layers(&["my layer"])
);

Dependencies

~3–12MB
~111K SLoC