1

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

1

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 '13 at 16:35
  • works like a charm. Edited answer. Thanx – aiao Feb 8 '13 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.