I'd like to know why and if someone knows a solution about saving pdf + latex gives the wrong path to the tex file.

So for instance:

If I save an svg inside mainfolder/subfolder as pdf with omit text.. Latex, it will save the \input..{filename.pdf_tex} without the subfolder, so instead of saving it as \input..{subfolder/filename.pdf_tex}.

That leaves me adding the subfolder every time, manually. Is there a solution for this?


Solved! with \graphicspath{{subfolder/}} in the preamble and inside the document with \input{subfolder/filename.pdf_tex}.

Source here: http://mirrors.ibiblio.org/CTAN/info/svg-inkscape/InkscapePDFLaTeX.pdf

| improve this answer | |

Inkscape itself cannot know in which .tex file you want to include the image nor where the main .tex file is located. So it can just add all the information is has, which is the file name.


If filename.pdf_tex is in a location which is automatically searched by latex, you don't need to add the path and just include it with \input{filename.pdf_tex}. Possibles locations for this:

| improve this answer | |
  • I honestly can't understand what I need to do to add the subfolder to TEXINPUTS, would you explain it easily? – user9613078 Apr 13 '18 at 20:20
  • This would be the solution which your refer to when you talk about "automatically searched by latex", right? – user9613078 Apr 13 '18 at 20:22
  • @user9613078 If you are not familiar with setting environment variables, I suggest to first try with the \input@path. Add something like \makeatletter \providecommand*{\input@path}{} \g@addto@macro\input@path{{subfolder//}} \makeatother to your preamble – samcarter_is_at_topanswers.xyz Apr 13 '18 at 21:31
  • @user9613078 If you'd rather go the TEXINPUTS route, it would be helpful to know which operating system you use and which shell type you have. – samcarter_is_at_topanswers.xyz Apr 13 '18 at 21:33
  • Ubuntu 17.10, with gnome shell type – user9613078 Apr 13 '18 at 21:35

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.