[XeTeX] Import svg

Pander pander at users.sourceforge.net
Mon Dec 3 08:55:20 CET 2012


On 2012-12-01 16:28, Tobias Schoel wrote:
> Hi,
> 
> can this be made into a package?
> 
> That'd be great!
> 
> Thanks
> 
> bye
> 
> Toscho
> 
> On 30.11.2012 11:01, Boris Kheyfets wrote:
>> 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}|

I have the same problem with xelatex (with and without -8bit).

>> 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>).

Please report a fix if you find one. +1 one on making a package out of this.

Thanks,

Pander

>> -- 
>> Boris
>>
>>
>>
>>
>>
>>
>>
>>
>> --------------------------------------------------
>> Subscriptions, Archive, and List information, etc.:
>>    http://tug.org/mailman/listinfo/xetex
>>
> 
> 
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex



More information about the XeTeX mailing list