[Tex/LaTex] includesvg cannot include svg

graphics

I am trying a very simple example of trying to import a svg image, I am following the manual on http://mirrors.acm.jhu.edu/ctan/graphics/svg/doc/svg.pdf but this doesn't work at all:

\documentclass{article}
\usepackage{svg}
\begin{document}
\includesvg{p.svg}
\end{document}

but I get an error:

! LaTeX Error: Unknown graphics extension: .svg

which shouldn't happen. I don't want to have to keep converting between SVG and EPS (which I can import) because this complicates the image-making process and clutters my directories.
I'm trying to use includesvg the same way I would use includegraphics, just like the manual said. The manual isn't giving working examples, and this error doesn't even show up on google searches.

How can I import an SVG image?

Best Answer

How to include an SVG file, with the minimal working example, with the file "p.svg":

\documentclass{article}
\usepackage{svg}
\begin{document}
\includesvg[width=\textwidth]{p}
\end{document}

but.... the package svg-extract (or inkscape) may or may not be installed on your system, which you can install on Ubuntu with

con@e:~/Scripts$ sudo tlmgr install svg-extract
[sudo] password for con: 
(running on Debian, switching to user mode!)
cannot setup TLPDB in /home/con/texmf at /usr/bin/tlmgr line 5604

ignore the last line, it works without this.

The latex script can be compiled to PDF with this:

pdflatex --shell-escape svg_graphic.tex