0

I have the following code:

\documentclass[12pt]{article}
\usepackage{svg}
\setsvg{inkscape=inkscape -z -D, inkscapeversion=1, svgpath=figures/}

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

Running the code example in TexStudio with txs:///pdflatex/[--shell-escape] results in the following error:

Package svg Error: File 'fig_svg-tex.pdf' is missing. \includesvg[width=0.5\textwidth]{fig}

The image's path is ./figures/fig.svg. Why isn't it exproted to pdf format? Any ideas how to make that work?

1 Answer 1

1

The error was in the setup. The following code is working fine:

\documentclass[12pt]{article}
\usepackage{svg}
\svgsetup{inkscapeexe=inkscape, inkscapearea=drawing, inkscapeversion=1}
\svgpath{{figures/}}

\begin{document}
    
    \begin{figure}
        \centering
        \includesvg[width=0.5\textwidth]{fig}
    \end{figure}
    
\end{document}
1
  • This code allows for automatically including of files made on Inkscape? Even with the text and all? That's neat!
    – Jes
    Commented Feb 16, 2021 at 18:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .