TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For writing a lecture note, I have put my images in a subdirectory named "image". In the main.tex file I have added \graphicspath{{image/}}. I have also included:


 {inkscape -z -D --file=#1.svg %
 --export-pdf=#1.pdf --export-latex}%

in order to include pdf_tex files.

In the main.tex file I am inserting the SVG file by:


but I am getting the following error:

! LaTeX Error: File `relativeposition.pdf_tex' not found.

Can anyone tell me what I should do to keep all my SVG files in the image subdirectory and input them from main.tex?

share|improve this question
Welcome to TeX.SX! Wouldn't it be simpler if you say \input{image/filename.pdf_tex}? In case of only one subdirectory it's not so heavy. – egreg Oct 15 '12 at 9:26
writing \input{image/filename.pdf_tex} is not working i am getting the same error as the one mentioned above – mkj Oct 15 '12 at 18:06

A quick hack that allows you to write


taking into account all subpaths defined with \graphicspath is to add

  \tl_map_inline:cn { Ginput@path }
    \InputIfFileExists{##1#1}{ \tl_map_break: } { }

to your document preamble.

However, if only one subdirectory is defined in \graphicspath it's probably easier to define


where you simply add image (or the name you want to give to the subdirectory).

share|improve this answer
Concerning your second suggestion should i add only the \newcommand{ \svginput}[1]{\input{image/#1}} or i should add the \usepackage{xparse} also to the preamble. \\ another question when using \svginput should i use it beside an \begin{figure} \svginput{relativeposition.pdf_tex} \end{figure} – mkj Oct 15 '12 at 18:05
Thanks for your answer i have followed your answer and it is working now. – mkj Oct 16 '12 at 18:59

Your Answer


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.