[Tex/LaTex] Input file folder


In my main LaTeX file I'm using a number of input files which are dynamics (changing the contents). I want to put some of these files in a higher order folder but at the same time don't want to fix it name.


how can I change it so that it looks files in Latexmainfile as well as ONLY in (Filefolder)


Best Answer

The following is written to accord to Mac OS Xs' FHS implementation. This is principally valid for any UNIX-like OS. Pdflatex allows you to specify complete paths:


Under Unix-Like systems you may even use shell(bash) variables in you paths:


or common abbreviations


(note: using \string here to tell latex to pass the character to shell instead of taking the "meaning")

Of course you may also specify relative paths. This means of course you need to know what your active path is. For pdflatex this is most commonly the path (or directory) were yout main document lies (which is given pdflatex as an argument).


This will tell pdflatex to use some_file which is located in the active dir. (If not an error will be raised.)


Will do exactly the same, while


will tell pdflatex to use some_file which lies in the parent folder (one level above.)

So one might ask why? Well under common OSs like UNIX or Windows the dot representations are in charge, so that . represents the current/active folder and .. the parent. Therefore ../../ will represent a folder two levels above (the parent of the parent). This is possible, since the directory tree only knows one parent a a certain level. So 'going up' is all the same on any level.