1

Is it possible to include SVG code into LaTex? If it's possible how can I do that ? Short Example:

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
    <path d="M150 0 L75 200 L225 200 Z" />
</svg>

I do not have a file with extension .svg, and I have access only to its code. For result I want to display svg "image".

1
  • 1
    Any reason for using the SVG code instead of including a SVG file? After all, a SVG file is just a XML file. – Alexis Pigeon Dec 5 '13 at 12:38
3

You can use svg data inside a tikzpicture:

\documentclass[tikz, border=4pt]{standalone}
\usepackage{amsmath,mathpazo}
\usetikzlibrary{svg.path}

\begin{document}

\begin{tikzpicture}
    \draw svg "M150 0 L75 200 L225 200 Z";
\end{tikzpicture}

\end{document}

tikz svg triangle

Not the answer you're looking for? Browse other questions tagged or ask your own question.