package guide#

svg2tikz.convert_file(svg_file, no_output=True, returnstring=True, **kwargs)#

Convert SVG file to tikz code

Parameters:
  • svg_file (str, stream object) – input file representend by a path or a stream

  • no_output (Bool) – If the output is redirected to None (default: True)

  • returnstring (Bool) – if the output code should be returned

  • kwargs – See argparse output / svg2tikz -h / commandline documentation

Returns:

tikz code or empty string

Return type:

str

svg2tikz.convert_svg(svg_source, no_output=True, returnstring=True, **kwargs)#

Convert SVG to tikz code

Parameters:
  • svg_source (str) – content of svg file

  • no_output (Bool) – If the output is redirected to None (default: True)

  • returnstring (Bool) – if the output code should be returned

  • kwargs – See argparse output / svg2tikz -h / commandline documentation

Returns:

tikz code or empty string

Return type:

str

Examples:

from svg2tikz import convert_svg

var_svg = """<svg>
...
</svg>"""
code = convert_svg(var_svg, ids=['1', '2', 'id2'], verbose=True)