Comment 5 for bug 1679487

Revision history for this message
Boris Dalstein (dalboris) wrote :

Note: this SVG file also exhibits the following export error:

https://bugs.launchpad.net/ubuntu/+source/inkscape/+bug/1417470

I fixed it by using the following definition of \includesvg, inspired by one comment in the above bug:

\newcommand{\includesvg}[2][]{%
\executeiffilenewer{images/#2.svg}{images/#2.pdf}%
{\unexpanded{PDF_FILE="./images/#2.pdf"; inkscape -z --file=./images/#2.svg --export-pdf=$PDF_FILE --export-latex; sed -i 's/\\\\/\n/g' ${PDF_FILE}_tex; MAXPAGE=$(pdfinfo $PDF_FILE | grep -oP "(?<=Pages:)\s*[0-9]+" | tr -d " ") ; sed -i "/page=$(($MAXPAGE+1))/,\${/page=/d}" ${PDF_FILE}_tex; } }
\ifthenelse{\isempty{#1}}{\small}{#1}
\input{images/#2.pdf_tex}%
}