raui100
raui100

Reputation: 81

Embedding content of SVG file in latex document

I'm computing a plot and have the data in 'SVG' format as string in memory. I'd like to use that SVG string in a latex document, which is also being produced by computation.

I could save the file to my disk and then use the file in my latex document. However I'd prefer to simply put the string with the content of the SVG data directly in my latex document. How can I do that?

Upvotes: 1

Views: 1196

Answers (1)

If your svg plot is not too complicate, you could use the svg path operation of tikz:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{svg.path}

\begin{document}

\begin{tikzpicture}
\draw svg {M 0 0 L 20 20 h 10 a 10 10 0 0 0 -20 0};
\end{tikzpicture}

\end{document}

Upvotes: 2

Related Questions