5

I'm trying to include an image (edited in Inkscape) in my document. However, everytime I run the file , it says "File not found".

In Inkscape i have saved the document as .pdf and used the latex option as given by: http://www.howtotex.com/tips-tricks/inkscape-images-with-latex-fonts/

I have tried:

  • export area as page
  • export area as drawing,

to find out if that may be the problem, but error still persist.

Both the .pdf as .pdf_tex file are in the same file as my .tex file.

Note: The example image (given in link above), also in the same file as my .tex file, works perfectly.

This is the code i'm using:

\documentclass[]{article}
\usepackage{graphicx}
\usepackage{color}
\usepackage{transparent}
\begin{document}
\begin{figure}[htb]
\centering
\def\svgwidth{200pt}
\input{drawing4.pdf_tex}
\caption{Double pendulum}
\end{figure}
\end{document}

This is the error message that keeps showing up:

enter image description here

I am using Texmaker and Inkscape 0.48

Any help will be much appreciated

Kind regards,

Andrew


EXTRA:

So I think i should add this to give a little more insight into the problem.

This is the image i want to include in my document. The graph I copied it from another document using sniptool and paste it in Inkscape. I want to give it a header and add the symbols underneath so it can have the same font as my tex document. You know, to have a nice and uniform document.

When I draw some random figures in Inkscape and include text such as MoS$_2$ and export it to pdf+LaTeX, it work perfect.

I think it has something to do with editing this image.

What I added was: the text in the top and bottom and the blue numbers

Question reformulation: Can I edit a photo/image (adding text, arrows etc) in Inkscape and export it to pdf+latex and have it work perfectly?

Thank you in advance! enter image description here

  • Have you tried to include the example picture in the above mentioned link? howtotex.com/download/inkscape-howtotex.zip with \input{drawing.pdf_tex} instead of \input{drawing4.pdf_tex} – user36296 Jun 2 '14 at 11:21
  • 3
    The error message doesn't say "file not found" but "file ended while scanning ...". This means something is wrong with the content of the file. It sounds like a missing brace. – Ulrike Fischer Jun 2 '14 at 11:28
  • Yes @samcarter, I have tried to include the example picture in the above link, works perfectly. I think the problem how Inkscape saves my image as pdf+LaTex. – Andrew Jun 2 '14 at 22:29
  • @UlrikeFischer I wish I could figure out what is wrong with the content of the file and know where to add that missing brace. The whole day I have been trying, all possible ways with no luck. Thank you for your effort – Andrew Jun 2 '14 at 22:53
8

Update:

The "extra info" shows a percent sign in the label text: MoS$_2%--WS$_2$. The unprotected percent sign act as comment char, the rest of the line is ignored by TeX and leaves the \put that sets the label unfinished. A percent sign can be generated by \% in TeX, but I think it is just a typo and a $ sign is intended to close the math for the subscript: MoS$_2$--WS$_2$.

Older analysis:

Your drawing4.pdf_tex is broken, truncated inside the arguments of a \put command, the correct error message is:

! File ended while scanning use of \put.
<inserted text> 
                \par 
l.9 \input{drawing4.pdf_tex}

? 

A .pdf_tex file is basically:

\begingroup
  % some settings
  \begin{picture}(1,...)%
    \put(0,0){\includegraphics[width=\unitlength]{drawing4.pdf}}%
    \put(...,...){...}
    ...
  \end{picture}%
\endgroup

The following file

\begingroup
\begin{picture}(1,1)  
\put(0,

generates the same errors as drawing4.pdf_tex.

The inkscape export has failed, try again, possible reasons:

  • Inkscape export: Bug/error/abnormal abortion.
  • Disk full.
  • ...
  • Well I tried about 20x already (not exaggerating). The procedure for exporting is straight forward, and was done exactly as mentioned in the link above. I added extra info to the problem, so maybe that may give more insight. Thank you for your effort Heiko Oberdiek – Andrew Jun 2 '14 at 22:51
  • @Andrew: The extra info was indeed helpful and has shown a percent sign in the label text, see the updated answer. – Heiko Oberdiek Jun 2 '14 at 23:39

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.