1

I am trying to compile image which I created by Inkscape but I am getting the following error

! Package pdftex.def Error: File `first_sketch.pdf' not found.

the PDF file first_sketch is in the image folder with the first_sketch.pdf_tex and it is in PDF format. What does this error mean?

\documentclass[paper=a4, fontsize=11pt]{scrartcl}   % Article class 
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage[ngerman, english]{babel}

%%%%%%%%%%%%%%%%%%%%Vektor graphic packages%%%%%%%%%%%%%%
\usepackage{color}
\usepackage{transparent}
\graphicspath{{image/}}


%%% Begin document
\begin{document}


  \begin{figure}[H]
    \centering
  \def\svgwidth{175pt}
  \input{image/first_sketch.pdf_tex}

    \caption{Test}
    \label{fig2}
\end{figure}

\end{document}
Werner
  • 603,163
ocean
  • 283

2 Answers2

2

\graphicspath is used to set the paths where graphics may reside for use within your file/project. It has the following form:

\graphicspath{{<first/path>}{<second/path>}...{<last/path>}}

Note the fact that each elements within the set of paths have braces around it. This holds true for even a single path (\graphicspath{{<a/single/path>}}).

Regardless, you also need to

\usepackage{graphicx}

in order to use any form of graphics, before setting any \graphicspath.

Werner
  • 603,163
  • After adding the \usepackage{graphics} it works but after compiling, the letterings are distorted. How can I minimize the image so that the letterings above the arrows are minimized too? – ocean Feb 06 '15 at 09:32
  • maybe it will help if I find out how to change the length of the pdf file? as \svgwidth for width. – ocean Feb 06 '15 at 10:02
0

Well, the error means exactly what it says: LaTeX can't find the file that you're telling it to input. It's impossible for us to tell you why it's doing that because you didn't give us a minimum working example to save and run.

For future reference, this is more like a minimal example:

\documentclass{scrartcl}
\begin{document}
\input{image/first_sketch.pdf_tex}
\end{document}

I get the expected result with no errors when running this code. However, I got the same result running your code as posted above, when I removed the \graphicspath command. Before I removed that, I got a different error from yours. My thought, therefore, is that your problem is likely related to \graphicspath. I'd suggest reading the documentation on it carefully; and if you can't resolve it, consider just getting rid of it. Since you seem to be putting the directory name in your \input command anyway, this shouldn't be a problem.

If this doesn't solve your problem, construct a real MWE for people to test. To do this, keep paring down your file, one line at a time if necessary, until you've got the smallest possible file which still produces the error. Often this will show you what the problem is all by itself; if it doesn't, at least others can look at your work and not have to worry about a lot of code that's probably completely unrelated to the issue.

I hope this helps.

dgoodmaniii
  • 4,270
  • 1
  • 19
  • 36