Graphics, Figures & TablesInclude converted SVG Graphics from Inkscape inside Document

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mzagar
Posts: 1
Joined: Thu Mar 08, 2012 1:40 pm

Include converted SVG Graphics from Inkscape inside Document

Post by mzagar »

Hi,

I have a LaTeX file that works on my Linux machine. The code for SVG graphics is the following:

Code: Select all

\graphicspath{{gen/}{fig/}}


\newcommand{\includegraphicsvg}[2][]{%
  \ifnum\pdfstrcmp{\pdffilemoddate{fig/#2.svg}}%
  {\pdffilemoddate{gen/#2.pdf}}>0%
  {\immediate\write18{inkscape -z -D --file=fig/#2.svg %
      --export-pdf=gen/#2.pdf --export-eps=gen/#2.eps %
      --export-area-drawing}}\fi%
  \includegraphics[#1]{#2}%
}
and used like this:

Code: Select all

\begin{figure}
  \centering 
  [stransko odpiranje]{\label{fig:ste1}\includegraphicsvg[width=0.40\textwidth,height=0.40\textwidth,keepaspectratio]{ste1}}
  \caption{Pozicija nasedov stekel, pri različnih načinih odpiranja}
  \label{fig:stea}
\end{figure}
The problem is i get this error under Windows:
! LaTeX Error: File `ste1' not found.
As I see it, the Inkscape fails to run. I already added path variable for my Inkscape location. Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply