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 file
thanlatex somewhere/file
You can of course useTEXINPUTS=..//: latex main
then\input{intro}
would workimport
package might be usefull, repositorios.cpai.unb.br/ctan/macros/latex/contrib/import/…\input
with no paths seems the simplest thing to doimport
package seems to allow relative to relative paths, don't you like it?