So I had one answer (which is preserved below for posterity) but I think I understand the question a little better now. What you want is to write \input{foo}
and have LaTeX know where to search for foo
. Martin's answer offers one way to do this. Here are some others.
One way is to make a directory in your local texmf tree and put files you want to use in there. So (assuming a uni system) this will be something like ~/texmf/
Make a subdirectory e.g. ~/texmf/tex/latex/commonstuff/
and put your files in there. Then they will be available to \input
. Be careful about name clashes, though!
If, for whatever reason, you cannot move where your files are stored, you could add that directory to TEXINPUTS
which is a variable that stores the directories that tex searches for files called with \usepackage
\input
and similar commands.
Further reading:
I maintain that this may be overkill if the problem is simply that some files live in the folder "above" the one containing the tex file (when the ../
trick discussed below works fine)
I don't really understand the question. As far as I am aware, absolute paths work with \input
? I just tried one and it worked.
Sometimes it is easier to use relative paths, but to know how to use them. For example a lot of the time I want to insert a graphic which is housed in a different folder. Let's say I have the following:
Work
Document
main.tex
Graphics
img.pdf
In main.tex
I can write \includegraphics{../Graphics/img}
and this finds my image: ..
goes "up a level".