I'm trying to include PDF+LaTeX figures exported from Inkscape in my document. Both .pdf_tex and .pdf files are inside the same path, nested within the project root. These two pieces of code work nicely:




I wanted to make a macro of these, so I tried:




but calling either \includepdflatexOne{figs/}{myfig} or \includepdflatexTwo{figs/}{myfig} results in

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

Why doesn't LaTeX find the file when \input or \import are called from within a macro? I also tried subimport, but the same happened.

I believe my question may be related to this (unanswered) question, but reading it didn't help me.

Just in case, I'm using ShareLaTeX.

  • 2
    \input works the same way whether or not it is in a macro but it is hard to say why your file is not found just from these fragments. (setting graphicspath-per inclusion is rather odd but should work) Commented Aug 11, 2017 at 18:33

1 Answer 1


if #1 is \linewidth (your default) will be


which will be an error. You only want want set of braces.

  • @Marshall hmm you accepted this but it surely gave a syntax error at the length setting not (initially) the file not found error? Commented Aug 11, 2017 at 21:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .