[Tex/LaTex] Trouble converting svg file to pdf_svg using svg package

inkscapeshell-escapesvg

I am trying to convert svg file to pdf_tex file in Texmaker using Inkscape, with this preamble and document:

\documentclass[10pt]{article}% Package for chemical equation typesetting
\usepackage{siunitx} % Provides the \SI{}{} and \si{} command for typesetting SI units
\usepackage{graphicx} % Required for the inclusion of images

\usepackage{amsmath} % Required for some math elements 



    \usepackage{svg}
    \setsvg{inkscape=inkscape -z -D}

    \begin{document}

    \begin{figure}
      \centering
      \includesvg[width=0.5\textwidth]{image}
    \end{figure}

    \end{document}

where 'image' is a image.svg file and make pdflatex run:

pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex

however this error occured:

'inkscape' is not recognized as an internal or external command,
operable program or batch file.

I have added c:/Program Files/ Inkscape/inkscape.com in the PATH but this not working.

Best Answer

I had this problem as well. I was able to fix it defining the path to inkscape.

\documentclass[10pt]{article}

\usepackage{svg}
\setsvg{inkscape={"C:/Program Files/Inkscape/inkscape.com"}}

\begin{document}

\begin{figure}\centering
    \includesvg{cysteine}
\end{figure}

\end{document}