0

I have exported an Image from Inkscape to PDF/TEX. When trying to add it using

\input{images/myfile.pdf_tex}

I get an error

"Package pdftex.def Error: File `myfile.pdf` not found: ...

The documentation suggests that I should use \graphicspath{{images/}} so I have added that to my preamble but it still doesn't work. What's my mistake?

Edit: I also tried the alternative from the documentation to add \usepackage{import} to the preamble and add the image with \import{images}{myfile.pdf_tex} but it didn't work either. It results in

File `myfile.pdf_tex` not found...
  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – albert Oct 11 '18 at 13:39
  • Is myfile.pdf_tex and myfile.pdf in the same folder? images/? The n you can use \graphicspath, but you are using it wrong, the correct syntax is \graphicspath{{./images/}}, note a set of braces around each folder added this way. – daleif Oct 11 '18 at 13:45
1

You need

\graphicspath{{images/}}

not

\graphicspath{images/} 

then

\input{images/myfile.pdf_tex}

should work, or instead you can set TEXINPUTS to ./images: in the enviornment before calling pdftex then

\input{myfile.pdf_tex}

should work as tex and graphics files are found on the TEXINPUTS path.

  • Sorry, that was a copy error. I did have the extra braces and it still doesn't work. – Elias Oct 11 '18 at 13:49
  • 2
    @Elias we can only answer the questions as posted, please edit the question to show a small complete example that can be run to reproduce the error. – David Carlisle Oct 11 '18 at 13:52
0

It turned out that I needed to put the \graphicspath right above the line that included the image instead of in the preamble. So this worked:

\graphicspath{{images/}}
\input{images/myimage.pdf_tex}
  • That should not be necessary unless you're also messing with the graphics path in the preamble. Did you add it before or after loading graphicx? – daleif Oct 12 '18 at 11:09
  • @daleif I don't explicitly load graphicx at all it seems to be included in the .cls with \RequirePackage – Elias Oct 12 '18 at 11:14
  • Then you really ought to tell us more about this document. There is a reason why we always ask for a full but minimal example. A side reason is to get an idea of either badly prepared templates (there are a lot) or other setups that do things in ways that are undesirable for all users. – daleif Oct 12 '18 at 12:14
  • @daleif It's publicly available here: github.com/wannesm/adsphd – Elias Oct 12 '18 at 12:46
  • well, it is definitely doing stuff that it should not. Are you using \includechapter, it is explicitly resetting the graphicspath, nullifying what ever was there to begin with. I guess they are trying to force a specific directory structure with this class. See why this sort of information is important. Also it does not support xelatex or lualatex, as it is explicitly passing pdftex or dvips to graphicx. – daleif Oct 12 '18 at 12:56

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.