[Tex/LaTex] What happens to a relative path in a file added with \input{}

includeinput

I stumbled upon the following question:

In the preamble of my main tex file for my thesis, I've included several other files with definitions for abbreviations which are in the same path as main.tex, so I've only used the filename with the relative path to include them:

\include{abbrevations.tex}

For using some of my definitions also in other TeX-Documents (e. g. graphics created with IPE) I've created a file called IPE-Preamble.tex, which contains selected parts of my preamble, so also the lines \include{abbrevations.tex}.

Both mentioned files are located in the same path THESIS/

I've included the file IPE-Preamble.tex in many other files which are located in the path THESIS/graphics successfully, it works:

\input{/drive/path/path2/THESIS/IPE-Preamble.tex}

Now I wanted to use this file also in .tex files which are located elsewhere on the same computer (let's say path /drive/path3/path4/main2.tex). I used the same input command with the full path for IPE-Preamble as stated above, but I get an error message, that commands (which are defined in abbreviations.tex are "not defined", so it seems that the include command does not work in this case.

Does TeX search for the file /drive/path3/path4/abbreviations.tex because of the relative path of the include command in IPE-Preamble.tex?

Best Answer

The \include causes an .aux file to be written in the same directory of the included file; the most recent TeX distributions disallow writing in directories called with an explicit path or above the directory where the main file resides.

Use \input that doesn't suffer from these limitations, provided you have read access to the directories.