-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinkscape.sty
More file actions
24 lines (19 loc) · 818 Bytes
/
Copy pathinkscape.sty
File metadata and controls
24 lines (19 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
% automagically re-export the svgs to pdf_tex format
% requires inkscape. modify the path below as appropriate
% requires the '-shell-escape' flag to be passed to the latex compiler
\ProvidesPackage{inkscape}
%% change the variable below to suit your installation
\def\inkscape{/Applications/Inkscape.app/Contents/Resources/bin/inkscape }
%% command that checks for changes to the .svg file and
%% automatically re-exports it, as needed
\newcommand{\executeiffilenewer}[3]{%
\ifnum\pdfstrcmp{\pdffilemoddate{#1}}%
{\pdffilemoddate{#2}}>0%
{\immediate\write18{#3}}\fi%
}
%% wrapper for \executeiffilenewer and importer for the resulting format
\newcommand{\includesvg}[1]{%
\executeiffilenewer{#1.svg}{#1.pdf}%
{\inkscape -z -D --file=#1.svg --export-pdf=#1.pdf --export-latex}%
\input{#1.pdf_tex}%
}