4

I use \input for a subsection, in which I would like to include a pdf_tex file MK.pdf_tex via \input. The pdf_tex files are in a folder /fig. If I use \input{./fig/MK.pdf_tex} it returns the error "MK.pdf not found".

If I try to use the graphicspath as shown in the code below, I get the error "MK.pdf_tex" not found.

\usepackage{graphicx}
\graphicspath{{C:/Thesis/fig/}{./fig/}}
\begin{document}
\input{subsection}
\end{document}

And in my subsection:

\begin{figure}[!ht]
\centering
\def\svgwidth{8cm}
\input{MK.pdf_tex}  
\end{figure}

Thus, I assume that in the first case, only the pdf_tex gets the path information from input. In the second case I guess, that the graphicspath does not work.

If I put the MK files in the same folder as my subsection.tex, it works.

Thank you very much in advance, Doedork

Doedork
  • 51

1 Answers1

2

The \graphicspath{} command defines the directories only for \includegraphics{}, therefore in the \input command you have to use the relative position, like \input{./fig/MK.pdf_tex}. If I remember correctly, there is the \inputx package that allows doing the same for \input; maybe you want to give it a try.

MarcoG
  • 1,437
  • You remember incorrectly. ;-) See http://tex.stackexchange.com/questions/241828/define-path-for-packages-in-the-latex-file-analog-of-inputpath-or-graphicspa – egreg Sep 13 '15 at 09:36
  • @egreg Thanks, I didn't know that. I've found this answer: http://tex.stackexchange.com/questions/4602/how-to-make-the-main-file-recognize-relative-paths-used-in-the-imported-files/44215#44215. However, I could not make inputx work :-). – MarcoG Sep 17 '15 at 10:17