2

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!

  • 1
    Open a terminal, go to the directory of the .tex file and run pdflatex --shell-escape name_of_tex_file (I'm not sure that you can make this from texstudio). Provided you have Inkscape installed, it should be in your path (that only means that Inkscape's executable file is in a place where the system can find it, e.g. in /usr/bin/), so I don't think that should be a problem. – summer Mar 17 '15 at 1:21
  • 2
    In texstudio: go to Options->Configure texstudio. Click on Commands. Add -shell-escape flag to pdflatex: pdflatex.exe -synctex=1 -interaction=nonstopmode -shell-escape %.tex – remus Mar 17 '15 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.