# inkscape pdf+latex, unclean exit

I have expected this question to be asked before, but searched and no luck. It took some effort to produce this MWE. I have followed this link. When I pdflatex compile this, it produces an exit with code 1 on Kile, if it contains latex code. Even though the output file is good. Why is this unclean exit?

\documentclass[a4paper,10pt,twoside]{book}

\usepackage[pdftex]{graphicx}
\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}[!ht]
\centering
\includesvg{bar}
\end{figure}

\end{document}


main.tex: my source code

-
–  Claudio Fiandrino Feb 5 at 13:45
@ClaudioFiandrino , what exactly don't use like about the formatting? –  aiao Feb 5 at 13:48
add comment

## 1 Answer

Stumbled on solution while debugging another problem

\usepackage{xcolor}

This is not mentioned in the inkscape+pdf documentation. I think this can qualify as a bug. But it is hard to encounter since most work would \includepackage{xcolor} package for one reason or another. Further, beamer loads xcolor by default.

-
xcolor would be a more modern choice. Beamer, TikZ/PGF and many more use xcolor instead. –  percusse Feb 8 at 16:35
works like a charm. Edited answer. Thanx –  aiao Feb 8 at 16:37
add comment