Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to make use of "svg in tex" technology.

Here's a tex:

\documentclass{article}
\usepackage{color}
\usepackage{graphicx}

\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}
    \centering
    %\def\svgwidth{\columnwidth}
    \includesvg{svgfig}
    \caption{My SVG Image}
\end{figure}
\end{document}

One can take any svg image.

Then:

pdflatex -shell-escape tex-file

works, but

xelatex -shell-escape tex-file

and

xelatex -shell-escape -8bit tex-file

both give error:

! Undefined control sequence.
\executeiffilenewer #1#2#3->\ifnum \pdfstrcmp 
                                              {\pdffilemoddate {#1}}{\pdffil...
l.19     \includesvg{svgfig}
share|improve this question
XeTeX’s equivalent primitive is \strcmp not \pdfstrcmp, so it is a bug in the relevant package. – Khaled Hosny Nov 30 '12 at 14:37
@KhaledHosny: Now it gives: \executeiffilenewer ...m \strcmp {\pdffilemoddate. – Adobe Nov 30 '12 at 19:28
XeTeX does not have an equivalent primitive, I’m afraid. Unless you have hundreds of SVG images, may be you can just remove the \executeiffilenewer command and do the conversion on each run. – Khaled Hosny Nov 30 '12 at 19:42

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.