Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
2  
Welcome to TeX.SX. –  Claudio Fiandrino Feb 5 '13 at 13:45
    
@ClaudioFiandrino , what exactly don't use like about the formatting? –  aiao Feb 5 '13 at 13:48
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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