[XeTeX] Import svg

Boris Kheyfets kheyfboris at gmail.com
Fri Nov 30 10:01:05 CET 2012


Hello XeTeX users,

There's a solution to use svg in tex. Here's a minimial working (with
pdflatex) example:

\documentclass{article}

\usepackage{graphicx}
\usepackage{color}
\usepackage{epstopdf}

\newcommand{\executeiffilenewer}[3]{%
 \ifnum\pdfstrcmp{\pdffilemoddate{#1}}%
 {\pdffilemoddate{#2}}>0%
 {\immediate\write18{#3}}\fi%
}

\newcommand{\includesvg}[1]{%
 \executeiffilenewer{#1.svg}{#1.pdf}%
 {inkscape -z -D --file=#1.svg %
 --export-pdf=#1.pdf --export-latex}%
 \input{#1.pdf_tex}%
}

\begin{document}

\begin{figure}
  \def\svgwidth{200pt}
  \includesvg{first7BrZns}% it is first7BrZns.svg!
\end{figure}

\end{document}

Compilation with:

pdflatex -shell-escape tex-file

(the full paper is
here<http://www.tex.ac.uk/tex-archive/info/svg-inkscape/InkscapePDFLaTeX.pdf>
)

But in xelatex:

xelatex -shell-escape -8bit tex-file

gives error:

! Undefined control sequence.\executeiffilenewer #1#2#3->\ifnum \pdfstrcmp
                                              {\pdffilemoddate {#1}}{\pdffil...
l.19     \includesvg{svgfig}

What is wrong? How do I make it working?

(I also posted the question at
tex.se<http://tex.stackexchange.com/questions/84837/svg-from-inkscape-doesnt-work-in-xelatex>
).

--
Boris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20121130/fd8765c1/attachment.html>


More information about the XeTeX mailing list