[Tex/LaTex] Inkscape and –shell-escape with TexStudio

svgtexstudio

My purpose is to show fig1.svg in latex. Here is my code:

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{listings}
\lstset{language=Matlab}
\lstset{tabsize=2}
\usepackage{graphicx}
\usepackage{svg}

\begin{document}

\section{Introduction}

\begin{figure}[htbp]
\centering
\includesvg[width=140mm]{fig1}
\caption{Previous saturated output \label{overflow}}
\end{figure}

\end{document}

I got two error:

File `./fig1' not found. \includesvg[width=140mm]{fig1}
File `fig1.pdf_tex' not found. \includesvg[width=140mm]{fig1}

I followed this URL and everything is right except for

You need Inkscape on your path

You need to run the file with the –shell-escape option enabled

I use texstudio in ubuntu. So should I copy the .deb application on this path?!!! running which file with --shell-escape?

$ texstudio --shell-escap

still is the same!

Best Answer

A thing you should consider, apart from having the flag -shell-escape before the %.tex part, is to have TexStudio installed using apt-get, and not flatpak. If the latter, then the program will not be run at the environment where inkscape is installed. The same holds for inkscape.