I have a Latex document split across multiple files (.tex). Considering the main.tex file includes the intro.tex file:
\begin{document}
...
\input{intro.tex}
Both files are side by side in the same folder. I can build this with pdflatex in that directory.
But I'm considering to build (call pdflatex) from a dedicated build folder (which is in the same level). I mean, cd build and then pdflatex ../main.tex.
I've noticed that building from inside it (the build folder) requires a modification in the main.tex, I need to change the path of the inputs to:
\input{../intro.tex}
So, it seems the path is relative to where the build runs from. Instead, I would like the path to be relative to the file which has the \input command. Is it possible?
Also, I would like to point it's mentioned here that "... it is important to note that the paths are relative to the directory in which the main .tex file resides, not to the directory in which the included (or input) file is found. This is likely to be an issue ...", which in my understand isn't correct. As i said above, "it seems the path is relative to where the build (pdflatex) runs from". Right?
cd somewhere; latex filethanlatex somewhere/fileYou can of course useTEXINPUTS=..//: latex mainthen\input{intro}would work – David Carlisle Nov 19 '16 at 12:30importpackage might be usefull, http://repositorios.cpai.unb.br/ctan/macros/latex/contrib/import/import.pdf – KcFnMi Nov 19 '16 at 18:00\inputwith no paths seems the simplest thing to do – David Carlisle Nov 19 '16 at 18:22importpackage seems to allow relative to relative paths, don't you like it? – KcFnMi Nov 19 '16 at 18:25