1

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?

2 Answers2

1

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.


Workaround:

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:

  • 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
  • @user9613078 To add the subfolder to TEXINPUTS try to enter something like export TEXINPUTS=.:/home/path/to/the/subfolder//: in the terminal. This will change it for the current terminal session. If it works, you could permanently adjust it by adding it to your .profile or .bash_rc or .bash_profile (whichever you are using...) – samcarter_is_at_topanswers.xyz Apr 13 '18 at 21:41
  • And if I wanna do that with multiple subfolders, I would need to add every time export.. To the bashrc? What I mean is every time I make a mainfolder and a subfolder, I would need to add the subfolder path to bashrc? Can't I say every time I make a folder with a subfolder called images consider it as a path? – user9613078 Apr 14 '18 at 06:19
  • @user9613078 If you set TEXINPUTS to :.// it will search all subfolders of your current folder – samcarter_is_at_topanswers.xyz Apr 14 '18 at 12:14
  • Solved! with \graphicspath{{subfolder/}} in the preamble and inside the document with \input{subfolder/filename.pdf_tex} – user9613078 Apr 14 '18 at 16:10
1

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